Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Dialog box does not position correctly using FormStartPosition

Posted on 2006-11-09
2
Medium Priority
?
586 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

730 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