[Mono-bugs] [Bug 80163][Min] New - TextBox.ContextMenu is not null

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Dec 6 08:19:50 EST 2006

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by georgegiolfan at yahoo.com.


--- shadow/80163	2006-12-06 08:19:50.000000000 -0500
+++ shadow/80163.tmp.3184	2006-12-06 08:19:50.000000000 -0500
@@ -0,0 +1,55 @@
+Bug#: 80163
+Product: Mono: Class Libraries
+Version: 1.2
+OS: All
+OS Details: 
+Status: NEW   
+Priority: Minor
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com                            
+ReportedBy: georgegiolfan at yahoo.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: TextBox.ContextMenu is not null
+Description of Problem:
+The ContextMenu on a new TextBox is not null.
+Steps to reproduce the problem:
+Compile and run the following program.
+using System.Windows.Forms;
+class TestForm : Form {
+    static void Main() {
+        Application.Run(new TestForm());
+    }
+    public TestForm() {
+        TextBox TextBox = new TextBox();
+        MessageBox.Show((TextBox.ContextMenu == null).ToString());
+    }
+Actual Results:
+Expected Results:
+How often does this happen? 
+Additional Information:
+While the current Mono implementation would make sense, Microsoft Windows 
+Forms is just a wrapper. The initial context menu for a text box is native 
+and is not wrapped as an initial value for the ContextMenu property. 
+Extending the context menu is generally done either through platform 
+invoke or by replacing it completely. The current Mono implementation may 
+break applications that use the second method.
+This is caused by the line
+ContextMenu = menu;
+in the TextBox.TextBox().
+I suggest not assigning the value of "menu" to the ContextMenu, but 
+displaying it when the user triggers the context menu if the ContextMenu 
+property returns null.

More information about the mono-bugs mailing list