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 [EMAIL PROTECTED]

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

--- shadow/79077        2006-08-15 11:15:28.000000000 -0400
+++ shadow/79077.tmp.5268       2006-08-15 19:57:26.000000000 -0400
@@ -30,6 +30,52 @@
 
 ------- Additional Comments From [EMAIL PROTECTED]  2006-08-15 10:39 -------
 ->Mike
 
 ------- Additional Comments From [EMAIL PROTECTED]  2006-08-15 11:15 -------
 Were you attaching a sample?
+
+------- Additional Comments From [EMAIL PROTECTED]  2006-08-15 19:57 -------
+// Sample
+using System;
+using System.Windows.Forms;
+using System.Drawing;
+
+public class TestForm : Form
+{
+       static void Main ()
+       {
+               Application.Run (new TestForm ());
+       }
+
+       ListBox lb;
+
+       public TestForm ()
+       {
+               lb = new ListBox ();
+               lb.Location = new Point (5, 5);
+               lb.Items.AddRange (new object [] {"One", "Two"});
+               lb.Parent = this;
+               lb.SelectedIndexChanged += new EventHandler 
(OnSelectedIndexChanged);
+
+               Button button = new Button ();
+               button.Location = new Point (5, lb.Bottom + 5);
+               button.Size = new Size (100, 30);
+               button.Text = "Set SelectedItem";
+               button.Parent = this;
+               button.Click += new EventHandler (OnClick);
+       }
+
+       void OnClick (object o, EventArgs args)
+       {
+               lb.SelectedItem = null; // Should unselect items
+       }
+
+       void OnSelectedIndexChanged (object o, EventArgs args)
+       {
+               // Print info about the state of ListBox (SelectedIndex & 
SelectedItem)
+               Console.WriteLine ("Selected Item = " + (lb.SelectedItem == 
null ?
+"null" : lb.SelectedItem.ToString ()) +
+                               "\nSelected Index = " + lb.SelectedIndex + 
"\n");
+       }
+}
+
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to