[Mono-bugs] [Bug 79035][Nor] Changed - RadioButton: Keeps the focus even when another control gets Focus () called

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Aug 9 02:55:26 EDT 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 unserkonig at gmail.com.

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

--- shadow/79035	2006-08-09 02:53:15.000000000 -0400
+++ shadow/79035.tmp.12705	2006-08-09 02:55:26.000000000 -0400
@@ -38,6 +38,62 @@
 for CheckBox, and Click for Button control). This is very important too.
 
 ------- Additional Comments From unserkonig at gmail.com  2006-08-09 02:53 -------
 Created an attachment (id=17428)
 Source code which solves the bug
 
+
+------- Additional Comments From unserkonig at gmail.com  2006-08-09 02:55 -------
+
+using System;
+using System.Windows.Forms;
+using System.Drawing;
+
+public class TestForm : Form
+{
+	static void Main ()
+	{
+		Application.Run (new TestForm ());
+	}
+
+	TextBox tb1;
+	TextBox tb2;
+	RadioButton rb1;
+	RadioButton rb2;
+
+	public TestForm ()
+	{
+		tb1 = new TextBox ();
+		tb1.Location = new Point (5, 5);
+		tb1.Text = "One";
+		tb1.Parent = this;
+
+		tb2 = new TextBox ();
+		tb2.Location = new Point (125, 5);
+		tb2.Text = "Two";
+		tb2.Parent = this;
+
+		rb1 = new RadioButton ();
+		rb1.Checked = true;
+		rb1.Text = "Focus One";
+		rb1.Location = new Point (5, 35);
+		rb1.Parent = this;
+		rb1.CheckedChanged += delegate (object o, EventArgs args)
+		{
+			if (rb1.Checked) // If activated, move focus to tb1
+				tb1.Focus ();
+		};
+
+		rb2 = new RadioButton ();
+		rb2.Checked = false;
+		rb2.Text = "Focus Two";
+		rb2.Location = new Point (125, 35);
+		rb2.Parent = this;
+		rb2.CheckedChanged += delegate (object o, EventArgs args)
+		{
+			if (rb2.Checked) // If activated, move focus to tb2
+				tb2.Focus ();
+		};
+	}
+}
+
+


More information about the mono-bugs mailing list