Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / July 2007

Tip: Looking for answers? Try searching our database.

"CenterParent" not working

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
_dee - 22 Jul 2007 17:30 GMT
Not a critical problem, just annoying:

Normally I use :
this.StartPosition = FormStartPosition.CenterParent;
in the constructor of a dialog to make sure it doesn't show up in the
corner of the screen somewhere. But sometimes it doesn't work. I
suspect that it interacts with another property.

I've also tried setting via the Property Page...same result: The
position seems to shift, just not to where you'd expect.

Anyone know about this?
Marc Gravell - 22 Jul 2007 18:09 GMT
When you Show() / ShowDialog(), etc - do you specify the parent via
the overload?

Marc
Peter Duniho - 22 Jul 2007 18:36 GMT
> Not a critical problem, just annoying:
>
> Normally I use :
> this.StartPosition = FormStartPosition.CenterParent;
> in the constructor of a dialog to make sure it doesn't show up in the
> corner of the screen somewhere. But sometimes it doesn't work.

If you want the property to work consistently, then you need to  
consistently set the parent.  You can do this by passing a reference to  
the parent to the ShowDialog() method.

If that doesn't work, then something odd is going on.  You should post a  
concise-but-complete sample of code that reliably reproduces the problem  
in that case.

Pete

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.