I would like a message box to be displayed and the program to just continue and not wait for me to click ok on this message box. Can it be done ?
else
{
// Debug or messagebox the line that fails
MessageBox.Show("Cols:" + _columns.Length.ToString() + " Line: " + lines[i]);
}
use this
Hope it helps.
What you want are modeless forms. Here are some info and samples for you.
you need to use Multi Threading to achieve this task in which one thread (Main Thread) will do processing and other will be used to show the message-box.
This will start the MessageThread function in it's own thread so the rest of your code in what I called
MyProgram
can continue.Hope this helps.
You could also consider using a delegate.
The following snippits are from somthing i've just finished:-
First, the correct solution would be to replace the messagebox with a plain window (or form, if you are using winforms). That would be quite simple. Example (WPF)
If you want a quick-and-dirty solution, you can just call the messagebox from a throwaway thread:
(not sure if
ApartmentState.STA
is actually needed)