C#, Windows Form, Messagebox on top not working

Do it like this:

MessageBox.Show(
    "Message", 
    "Title", 
    MessageBoxButtons.YesNo, 
    MessageBoxIcon.Warning, 
    MessageBoxDefaultButton.Button1, 
    MessageBoxOptions.DefaultDesktopOnly);

It will put it in front of all other windows, including those from other processes (which is what I think you're asking for).

The critical parameter is MessageBoxOptions.DefaultDesktopOnly. Note that this will parent the message box to the default desktop, causing the application calling MessageBox.Show() to lose focus.

(You should really reserve this behaviour for critical messages.)

Alternatively, if your application has a window, call this.BringToFront() before showing the message box by calling MessageBox.Show() with the first parameter set to this. (You'd call this from the window form class).


Given an instance of your Form, you can call a MessageBox like this:
MessageBox.show(form, "Message", "Title"); (Check the doc for other parameters.)

However if you want to call this from a background thread (e.g.: BackgroundWorker) you have to use Form.Invoke() like this:

form.Invoke((MethodInvoker)delegate
{
   MessageBox.show(form, "Message", "Title");
});

I've answered this here (but since it's a fairly small answer, I'll replicate it):

using (var dummy = new Form() { TopMost = true })
{
    MessageBox.Show(dummy, text, title);
}