swathi
swathi

Reputation: 15

Message box in C# appears sometimes otherwise its seen in the taskbar

Currently in my application the Message box is seen sometimes correctly, In some instances seen in the taskbar which shouldn't happen.

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

   return false;
}

Upvotes: 0

Views: 674

Answers (1)

dante671
dante671

Reputation: 117

Sounds like you may need to set the owner property of the MessageBox, answered by @Charlie in this post C# / .NET messagebox is not modal

To do this use the MessageBox.Show(IWin32Window, String, String) method, details here http://msdn.microsoft.com/en-us/library/4y3c0fky.aspx

Upvotes: 1

Related Questions