It seems to me that you have some very ugly bug in your code! I'd focus on fixing this bug first. The easy way to do this is to set a breakpoint on the line that opens up the dialog. When the line is hit the second time (while the first dialog box is still open), view the stacktrace at that point and check all active threads (View Threads and View Stack windows) for the cause of the issue.
In addition, change your code to open a modal dialog window instead, where the parent window must be the owner. A modal dialog window will stop execution and prevent the parent window from processing user input (which could've lead to this behavior).
Edit
From your comments I gather that you have several threads that you cannot control and that you want one thread at a time to access the messagebox code. When working with threads, there are several synchronisation primitives available. Expanding on each of them requires a book (you may try Concurrent Programming on Windows, one that's thorough while the book has some flaws in its structure), knowing the right one for you requires knowledge of your code.
That said, you may wish to do something like the following, using a Mutex which at least prevents other threads to access the code (meaning: it will put them in a suspend state until the Mutex is released). Add a static boolean flag variable (or add a checkbox on the popupped form "show box only once") if you want to prevent the popup box to show more than once. Mutex plus flag solves two problems in one: only one thread will ever run that code, and the code will only run once, ever.
// as static class variable, create a mutex
private static Mutex dialogMutex = new Mutex();
// a static flag preventing the dialog box to show more than once
// (you may wish to resolve this differently, depending on req's)
private static boolean dialogIsShownOnce = false;
public static void ShowDialogBox()
{
// Wait until it is safe to enter, this makes the current thread
// the exclusive user of this code and other threads may only enter
// after the current thread finishes.
dialogMutex.WaitOne();
// depending on your requirements, you may not want this
// must come _after_ WaitOne to prevent entering before another
// thread that entered hasn't yet changed this variable
if(dialogIsShownOnce)
return;
// show your dialog box as a modal box
// if you are unsure: add a breakpoint just after the ShowDialog
// it should only be hit _after_ you dismiss the dialog box
yourForm.ShowDialog();
// set the flag, or the counter, or whatever you wish:
dialogIsShownOnce = true;
// Release the Mutex, this will remove the "roadblock" and allow
// other threads to enter this piece of code
dialogMutex.ReleaseMutex();
}
The code above is not tested and should be considered a hint on how to tackle this issue. There are so many ways to solve this, but I think the above method may just be what you need.