Question:
Microsoft Visual Studio problem?
?
2011-05-10 11:29:13 UTC
Hello, I have a small minor problem I'm having everytime I test my application.


My application is basically a bunch of dialog boxes that will pop up and say messages to the user. Everytime a dialog box comes up, it appears to be off the corner. Because most dialog boxes will just usually pop up in the middle of the screen. So mine would be the user would have to move every dialog to the middle everytime in order to read it properly. So is there a way I can have my dialog boxes pop up in the middle of the screen everytime, rather than the corner? Thank you!!
Three answers:
?
2011-05-10 11:47:08 UTC
Code Solution:-

Add WS_CENTER property to the dialog window.

style &= ~WS_CENTER;



Design View Solution:- (Resource editor)

Go to the design view and select your dialog.

Right click->Properties->

Select "More Styles" tab

There should be a checkbox "center". Check it.
?
2011-05-10 18:43:06 UTC
Isn't there a property you can set that controls where the dialogs appear? If you can't find it or if that is too inconvenient for whatever reason, I believe you could always make an event handler that gets called when the dialog box is created and manually move the window to the position you would like it to be at.
?
2011-05-10 18:45:55 UTC
One one of doing it might be to set the application start up location the center screen - but I don't know if this affects child windows or message boxes.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...