[Mono-bugs] [Bug 437683] ToolStripSplitButton issues

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Oct 23 05:46:36 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=437683

User johnm at hlaustralia.com.au added comment
https://bugzilla.novell.com/show_bug.cgi?id=437683#c2


John Mortlock <johnm at hlaustralia.com.au> changed:

           What    |Removed                                         |Added
----------------------------------------------------------------------------
                 CC|                                                |johnm at hlaustralia.com.au




--- Comment #2 from John Mortlock <johnm at hlaustralia.com.au>  2008-10-23 03:46:36 MDT ---
There is at least two problems I can see.

One mono Does not Fire the OnClick event when clicking the standard button,
attached is the code.

using System;
using System.Windows.Forms;
using System.Drawing;


public class test
{
        public class MyToolStripSplitButton : ToolStripSplitButton
        {
                protected override void OnClick (EventArgs e)
                {
                        Console.WriteLine ("OnClick");
                        base.OnClick (e);
                }

                protected override void OnButtonClick (EventArgs e)
                {
                        Console.WriteLine ("OnButtonClick");
                        base.OnButtonClick (e);
                }

                protected override void OnMouseUp (MouseEventArgs e)
                {
                        Console.WriteLine ("OnMouseUp");
                        base.OnMouseUp (e);
                }               
        }

        static void Main ()
        {
                Form f = new Form ();
                MyToolStripSplitButton btn = new MyToolStripSplitButton ();
                btn.Text = "Test";
                ToolStripMenuItem toolStripMenuItem1 = new ToolStripMenuItem
();

                ToolStrip s = new ToolStrip ();
                f.Controls.Add (s);

                s.Items.AddRange (new System.Windows.Forms.ToolStripItem[] {
btn});

                btn.Size = new System.Drawing.Size (32, 22);

                btn.DropDownItems.AddRange (
                        new System.Windows.Forms.ToolStripItem[] {
toolStripMenuItem1 });

                toolStripMenuItem1.Size = new System.Drawing.Size (152, 22);
                toolStripMenuItem1.Text = "Test";

                Application.Run (f);
        }
}


Expected Results: (As Per .NET 2)
 OnClick
 OnMouseUp
 OnButtonClick

Actual Results: (mono 2.0)
 OnMouseUp
 OnButtonClick





-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list