Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating MessageBox in a thread

Status
Not open for further replies.

stevensteven

Programmer
Jan 5, 2004
108
CA
Is it possible to create a new MessageBox in a thread, and be able to not select the window that called the message box?

// In Code
MenuHandler Callback

Create MessageBox in new Thread // It HAS to be in another thread

// Wait for For DialogResult And not allowed to select the window calling this
If(DialogResult == DialogResult.OK)
// Do Stuff
 
Hi,

Before the If statment you can wait for the other thread to be closed, and set your window state to disabled.
You van also put the If in a function that the thread will call.
 
korach,

Couple of questions.....

1. How do I wait for the thread to complete?
2. How can I get the result from the thread?

Thanks,

Steven
 
Hi,

1. Thread.Join();
2. This depends on how you define "result". If you mean to user-defined data, you can put the result in a shared variable.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top