Messagebox pop up behind mainform
-
I have a custom control that I has embedded controls. When I show a messagebox, the messagebox shows up behind the form. Topmost on the form is set to false. OpenFileDialog works as it is supposed to, why not messagebox? Any ideas? 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); } void b_Click(object sender, EventArgs e) { //using (OpenFileDialog dlg = new OpenFileDialog()) //{ // dlg.ShowDialog(this); //} MessageBox.Show(this, "hello"); }
-
I have a custom control that I has embedded controls. When I show a messagebox, the messagebox shows up behind the form. Topmost on the form is set to false. OpenFileDialog works as it is supposed to, why not messagebox? Any ideas? 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); } void b_Click(object sender, EventArgs e) { //using (OpenFileDialog dlg = new OpenFileDialog()) //{ // dlg.ShowDialog(this); //} MessageBox.Show(this, "hello"); }