how to: bring main form to front, when its modeless dialog comes into focus?

A

Assaf

hi all

i have a main form and it displays a modelss dialog.
when the user brings the dialog into focus,
the main form is left in the back.

how can i bring the main form into the front,
when its modeless dialog is selected into focus?

my code:

class MyMainForm
{
MyModelessDalog _MyModelessDalog = new MyModelessDalog();

MyMainForm()
{
this._MyModelessDalog.Owner = this;
}

void ShowDialog()
{
this._MyModelessDalog.Show();
}
}

class MyModelessDalog
{


}

Assaf
 
D

DalePres

Do it this way (I am changing the form names for simplicity)

public class Form1()
{
..
..
Form2 form2 = new Form2();
this.AddOwnedForms(form2);
form2.Show();
..
..
}

Dale
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top