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

  • Thread starter Thread starter Baron
  • Start date Start date
B

Baron

I have a dialog,
can i set it to modal or modeless before showing it?

thx
 
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.
 

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

Back
Top