Hiding and Showing a modal form

  • Thread starter Mohammad Tarhsaz
  • Start date
M

Mohammad Tarhsaz

Hi , all

In non .NET world(WIN API) i could have a hidden modal dialox box.
But ShowDialog in .NET is dependent to Visible property !!!

Suppose i have a Modal form and i make it hide(via this.Hide()) from
another thread , someone tell me why after that my form is closed.

I'm so angry of that , because a lot googling( MSFT staff hate this :))
) i find for a simplpe thing such as hinding and showing a modal form
you have to use some tricks . i don't i have to Cry or laugh

My real problem is : i want update something on form(From another thared
via Invoke) while is hidden and whenever i like i make that Visible or
Invisible again . is it a BIG thing i can't()

Some one help me and others.
 
G

Guest

Mohammad said:
Hi , all

In non .NET world(WIN API) i could have a hidden modal dialox box.
But ShowDialog in .NET is dependent to Visible property !!!

Suppose i have a Modal form and i make it hide(via this.Hide()) from
another thread , someone tell me why after that my form is closed.

I'm so angry of that , because a lot googling( MSFT staff hate this :))
) i find for a simplpe thing such as hinding and showing a modal form
you have to use some tricks . i don't i have to Cry or laugh

My real problem is : i want update something on form(From another thared
via Invoke) while is hidden and whenever i like i make that Visible or
Invisible again . is it a BIG thing i can't()

Some one help me and others.

I use Application.Run(...) and then hide the form (this.Hide() ) and saw
the control of application didn't quit and my app still was in process
list , is this way a true approch ?
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Mohammad,

Closing modal form (shown using ShowDialog) actually hide it. The form is
not destroyed and it can be reshown by simply calling ShowDialog again.

Make sure that you don't Dispose (e..g calling Dispose method or using the
reference in a *using* statement) or instantiate the form agian.
 
G

Guest

Stoitcho said:
Mohammad,

Closing modal form (shown using ShowDialog) actually hide it. The form is
not destroyed and it can be reshown by simply calling ShowDialog again.

Make sure that you don't Dispose (e..g calling Dispose method or using the
reference in a *using* statement) or instantiate the form agian.
Thanks so much for your reply , my problem solved.
 

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