How can I make a dialog Modal and Modeless @ runtime?

  • Thread starter Thread starter Baron
  • Start date Start date
You have to decide at the time that you show it. If you want to capture
the state earlier in the program, you can save it in a property of
the form.

if ( bSomeCondition )
{
myForm.ShowItModal = true;
}
else
{
myForm.ShowItModal = false;
}

Then later in the program when you need to show the form you can refer
to the form's property like this:

if ( myForm.ShowItModal )
{
myForm.ShowDialog();
}
else
{
myForm.Show();
}

Just a suggestion.
 
Back
Top