Keep Messagebox.show() on top of other application using c#

I tried the solution provided by donutboy and it doesn’t seem to accept 0x40000 (or 40000) as a valid option as a MessageBoxOptions Enum value.

However I have found that using MessageBoxOptions.DefaultDesktopOnly has the same effect and keeps the MessageBox on top until it is confirmed by the user.
ie.

MessageBox.Show("Hello there", "Prompt", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);

This is likely the simplest native solution on offer.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)