[Mono-bugs] [Bug 78737][Maj] New - Form.BringToFront not working
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Fri Jun 30 07:43:30 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 kuba.brecka at gmail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=78737
--- shadow/78737 2006-06-30 07:43:30.000000000 -0400
+++ shadow/78737.tmp.14296 2006-06-30 07:43:30.000000000 -0400
@@ -0,0 +1,82 @@
+Bug#: 78737
+Product: Mono: Class Libraries
+Version: 1.1
+OS: All
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Major
+Component: Windows.Forms
+AssignedTo: peter at novonyx.com
+ReportedBy: kuba.brecka at gmail.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Form.BringToFront not working
+
+Reproduce code:
+
+using System;
+using System.Windows.Forms;
+
+public static class Global
+{
+ public static Form F1;
+ public static Form F2;
+
+ public static void PrepareForm(Form F, EventHandler E)
+ {
+ F.Width = 600;
+ F.Height = 400;
+
+ F.StartPosition = FormStartPosition.Manual;
+ F.Left = 0;
+ F.Top = 0;
+
+ Button B = new Button();
+ B.Text = F.ToString();
+ B.Click += E;
+ F.Controls.Add(B);
+ }
+}
+
+public class Form1 : Form
+{
+ public static void Main()
+ {
+ Global.F1 = new Form1();
+ Global.F2 = new Form2();
+
+ Application.Run(Global.F1);
+ }
+
+ public Form1()
+ {
+ Global.PrepareForm(this, new EventHandler(B_Click));
+ }
+
+ void B_Click(object sender, EventArgs e)
+ {
+ Global.F2.Show();
+ Global.F2.BringToFront();
+ }
+}
+
+public class Form2 : Form
+{
+ public Form2()
+ {
+ Global.PrepareForm(this, new EventHandler(B_Click));
+ }
+
+ void B_Click(object sender, EventArgs e)
+ {
+ Global.F1.Show();
+ Global.F1.BringToFront();
+ }
+}
+
+When I run this code on MS.NET Framework, clicking the buttons correctly
+switches the forms. If I run it on Mono BringToFront has no effect.
More information about the mono-bugs
mailing list