[Mono-bugs] [Bug 82344][Nor] New - Adding ComboBoxes within the Application Loop make them work wrong

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Aug 6 15:39:19 EDT 2007


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 migliore.carmelo at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=82344

--- shadow/82344	2007-08-06 15:39:19.000000000 -0400
+++ shadow/82344.tmp.24427	2007-08-06 15:39:19.000000000 -0400
@@ -0,0 +1,79 @@
+Bug#: 82344
+Product: Mono: Class Libraries
+Version: 1.2
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com                            
+ReportedBy: migliore.carmelo at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Adding ComboBoxes within the Application Loop make them work wrong 
+
+Description of Problem:
+   ComboBoxes added to the Form's Controls after Application.Run() work wrong :
+   -> Text property is invisible
+   -> Impossible to place the cursor in the ComboBox
+   The test class is join to show the problem.
+
+Compilation : 
+   mcs -r:System,System.Windows.Forms test.cs
+
+Steps to reproduce the problem:
+   Click on the Add Button and see that nothing appears in new ComboBoxes 
+
+How often does this happen? 
+   Always
+
+
+--------------------------
+using System;
+using System.Windows.Forms;
+
+public class test : Form
+{
+	private Button btn;
+	public int nTest=0;	
+	
+	public test()
+	{	
+		init();	
+	}	
+	
+	private void init()
+	{	
+		btn = new Button();
+		btn.Dock = DockStyle.Bottom;
+		btn.Text = "Click to Add a ComboBox";
+		btn.Click += new EventHandler(this.On_Click);
+		this.Controls.Add(btn);
+		
+		On_Click(this, null);
+		On_Click(this, null);					
+	}
+
+	public static void Main()
+	{	
+		test fen = new test();
+		Application.Run(fen);			
+	}
+	
+	private void On_Click(object sender, EventArgs e)
+	{
+		nTest++;
+		
+		ComboBox cmbx = new ComboBox();
+		cmbx.Dock = DockStyle.Top;
+		cmbx.Items.Add("Test a"+nTest.ToString());
+		cmbx.Items.Add("Test b"+nTest.ToString());
+		cmbx.SelectedIndex = 1;
+		
+		this.Controls.Add(cmbx);	
+	}
+}


More information about the mono-bugs mailing list