我有一些弹出消息框的代码:
MessageBox.Show(this,
"You have not inputted a username or password. Would you like to configure your settings now?",
"Settings Needed",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);
Run Code Online (Sandbox Code Playgroud)
我的问题是当弹出我的应用程序通常最小化到托盘.因此,消息框不会出现在前面,也不会出现在起始栏中.看到它的唯一方法是通过alt-tabbing.
以下代码可以最小化我的应用程序(父级)到托盘:
if (FormWindowState.Minimized == WindowState)
{
Hide();
}
Run Code Online (Sandbox Code Playgroud)