Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Messagebox pop up behind mainform

Messagebox pop up behind mainform

Scheduled Pinned Locked Moved C#
hardwarequestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bradsnobar
    wrote on last edited by
    #1

    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"); }

    E 1 Reply Last reply
    0
    • B bradsnobar

      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"); }

      E Offline
      E Offline
      engsrini
      wrote on last edited by
      #2

      Instead Use MessageBox.ShowDialog(), if u deliberately want to use MessageBox.Show mean pass the mainform's handle as the first parameter(owner) of Messagebox.Show

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups