Closed bazzacad closed 4 years ago
Hi,
Thank you for your question.
The AutoClosingMessageBox is only the wrapper to the MessageBox class, thus you can use the same approaches here:
use the IWin32Window owner
parameter to put the AutoClosingMessageBox on top of the specific application window:
AutoClosingMessageBox.Show(this, "Hello, World!");
AutoClosingMessageBox.Show(new Form(){ TopMost = true }, "Hello, World!");
use the AutoClosingMessageBox.Factory
method to show the MessageBox in a custom manner:
AutoClosingMessageBox.Factory(
showMethod: (caption, buttons) =>
return MessageBox.Show(this,
"You did not enter a server name. Cancel this operation?",
caption, buttons,
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button1,
MessageBoxOptions.ServiceNotification); // <<<<<<<< trick
caption: "No Server Name Specified"
).Show(buttons: MessageBoxButtons.YesNo);
Please try this solution, and let me know your results.
Related Links: Why isn't MessageBox TopMost? MessageBoxOptions Enum
How do I give it focus so it shows up on top of other windows?