Click here to Skip to main content
15,886,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,

How can I change the message Box default position to my convenient position in the windows forms.

Regards
Vasanth
Posted

You can create your own message box.Because you can't change message box default position of windows forms.See some discussion over this...and last one is the link to create your own messagebox.
http://stackoverflow.com/questions/5289148/how-do-i-change-the-messagebox-location[^]
http://stackoverflow.com/questions/5706369/how-to-set-a-custom-position-for-a-messagebox[^]
A Custom Message Box[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 17-Aug-12 17:14pm    
Exactly, a 5.
--SA
ridoy 18-Aug-12 2:22am    
Thanks Sergey..
You can't.
You can create a Form that looks like a MessageBox and set the Location property to where you want; set the StartPosition property to FormStartPosition.Manual and use the ShowDialog() method to display it as a Modal dialog.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 17-Aug-12 17:14pm    
Right, a 5. OP could also create an improved version... :-)
--SA
Here's one example you could possibly use: How to make MessageBoxes center on their parent forms[^]
 
Share this answer
 
There are a number on codeproject. Here is one:

A drop-in replacement for MessageBox()[^]
 
Share this answer
 
HTML
You can not change the attributes of the message box. You will have to create your own form() and use it as a message box. This way you can define everything about it (position, size, etc)


VB
var form = new Form
                       {
                           StartPosition = FormStartPosition.Manual, 
                           ShowInTaskbar = false,
                           Location = new Point(100,100)
                       };
        form.ShowDialog();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900