C#中的消息框有时会出现在任务栏中

时间:2012-10-22 07:03:34

标签: c#

目前在我的应用程序中,有时会看到消息框正确,在任务栏中看到的某些情况不应该发生。

if (!flag)
{
   MessageBox.Show("Fileds Cannot be empty. Please follow the format", "Message");

   return false;
}

1 个答案:

答案 0 :(得分:1)

听起来你可能需要设置MessageBox的owner属性,@ Charlie在这篇文章中回答C# / .NET messagebox is not modal

为此,请使用MessageBox.Show(IWin32Window,String,String)方法,详细信息请http://msdn.microsoft.com/en-us/library/4y3c0fky.aspx

相关问题