Please help. MessageBox.Show(this, "hello") pops up behind my mainform
-
Has anyone encountered a message box that pops up behind the main form? How do I fix this? private void button13_Click_1(object sender, EventArgs e) { item i = new item(); Button b = new Button(); b.Text = "hello"; b.Click += new EventHandler(b_Click); subItem s = new subItem("hello"); s.EmbeddedControl = b; i.SubItems.Add(s); this.myListView1.Items.Add(i); //my custom windows control } void b_Click(object sender, EventArgs e) { MessageBox.Show(this, "hello"); //this is refering to the main form in here... }
-
Has anyone encountered a message box that pops up behind the main form? How do I fix this? private void button13_Click_1(object sender, EventArgs e) { item i = new item(); Button b = new Button(); b.Text = "hello"; b.Click += new EventHandler(b_Click); subItem s = new subItem("hello"); s.EmbeddedControl = b; i.SubItems.Add(s); this.myListView1.Items.Add(i); //my custom windows control } void b_Click(object sender, EventArgs e) { MessageBox.Show(this, "hello"); //this is refering to the main form in here... }
Check the properties of your mainform and make sure that topmost is set to false.
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview Archive -
Has anyone encountered a message box that pops up behind the main form? How do I fix this? private void button13_Click_1(object sender, EventArgs e) { item i = new item(); Button b = new Button(); b.Text = "hello"; b.Click += new EventHandler(b_Click); subItem s = new subItem("hello"); s.EmbeddedControl = b; i.SubItems.Add(s); this.myListView1.Items.Add(i); //my custom windows control } void b_Click(object sender, EventArgs e) { MessageBox.Show(this, "hello"); //this is refering to the main form in here... }
-
topmost is false
-
Check the properties of your mainform and make sure that topmost is set to false.
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview Archivetopmost is false