How to Make Message Box as Modal
HI,
Iam using the MessageBoxes in my Appliation. These Message Boxes are used to display the Exception messages encountered during the User Operation on the Application.
MessageBox.Show(Message,Title,Buttons,Icons);
These MessageBoxes are displaying the messages in Modeless Way, i want these MessageBoxes to be Modal. Please suggest a way to achieve the same.
Thanks in Advance,
Harry
Re: How to Make Message Box as Modal
You need to call the other Show method that supplies a parent for the MessageBox dialog to have it behave in a modal way.
The method I'm describing has the parent described as a "IWin32Window" data type in it's first parameter.
Obviously the parent specified should be the parent window you want this to be a child of.
Hope this helps,
- Nigel
Re: How to Make Message Box as Modal
Thanks for ur reply.
I had used the other way. Something like this,
DialogResult dlgResult = MessageBox(Message,Title,Buttons,Icons);
This makes the Message Box Modal and can be used to check the User Choice also.
Harry
Re: How to Make Message Box as Modal
Code:
DialogResult dlgResult = MessageBox.Show(Message,Title,Buttons,Icons);