Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Dialog box does not position correctly using FormStartPosition

Posted on 2006-11-09
2
Medium Priority
?
587 Views
Last Modified: 2012-06-21
I cannot get my dialog box to display anywhere other than the top left corner.  I've seen posts where people claim that they have gotten this to work.  Any ideas???

HERE'S THE CODE...
RequestValidateForm frmValidate = new  RequestValidateForm();
frmValidate.requestValidateCtl1.oValidateResult = oValidateResult;
                              
frmValidate.StartPosition = FormStartPosition.CenterParent;
                              
DialogResult oResult =  frmValidate.ShowDialog(this);

I'VE ALSO TRIED...
frmValidate.StartPosition = FormStartPosition.Manual;
frmValidate.Location = new Point(SystemInformation.WorkingArea.Width / 2 - frmValidate.Size.Width / 2, SystemInformation.WorkingArea.Height - frmValidate.Size.Height);

AND THIS...
frmValidate.StartPosition = FormStartPosition.Manual;
frmValidate.Top = 150;
frmValidate.Left = 150;
0
Comment
Question by:thespiceman
2 Comments
 
LVL 3

Accepted Solution

by:
troywillmot earned 1500 total points
ID: 17911399
That code seems to work fine for me. Is it possible there is code in your RequestValidateForm form class that is repositioning the form or preventing the location from being set (a property/method override or some code setting top/left/location etc) ?

Which version of VS/C# are you using ?
0
 

Author Comment

by:thespiceman
ID: 17916522
I checked and there were no overrides.  What I DID find was that the form was set to Maximized, i.e. WindowState=Maximized.  It is working now :)  Thanks!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Integration Management Part 2
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question