By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,552 Members | 893 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,552 IT Pros & Developers. It's quick & easy.

How to show a modal form, from within another thread?

P: n/a
Hi all,

I have written a program, which uses some threads.
I call thread t from the main thread, and then after some work t must
show a modal window.(e.g. a messagebox) but because t is not the main
thread, the window appears non-Modal.

Is it possible to show a modal form, from within another thread?

thnx in advance.
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"MSDousti" <MS******@myrealbox.com> schrieb

I have written a program, which uses some threads.
I call thread t from the main thread, and then after some work t
must show a modal window.(e.g. a messagebox) but because t is not the
main thread, the window appears non-Modal.

Is it possible to show a modal form, from within another thread?


Call the BeginInvoke or Invoke method of any control (this includes Forms)
that has been created in the main thread. You can pass a Delegate to
(Begin)Invoke. The Delegate points to a function that that calls ShowDialog.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.