Ok, I'm looking for something pretty simple: creating a MessageBox that doesn't stop my code.
I'm guessing I'll have to create a different thread or something? Please advise on the best way to accomplish this.
Thanks!
Ok, I'm looking for something pretty simple: creating a MessageBox that doesn't stop my code.
I'm guessing I'll have to create a different thread or something? Please advise on the best way to accomplish this.
Thanks!
No, You're going to have to make your own message box form. the MessageBox
class only supports .ShowDialog()
which is a modal operation.
Just create a new form that takes parameters and use those to build up a styled message box to your liking.
You could spin up another message pump by calling it on separate thread. MessageBox.Show
pumps message so it is safe to do without a call to Application.Run
.
public void ShowMessageBox()
{
var thread = new Thread(
() =>
{
MessageBox.Show(...);
});
thread.Start();
}