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# / September 2007

Tip: Looking for answers? Try searching our database.

how calc the DesktopLocation of a control on a Form?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve Richter - 09 Sep 2007 21:33 GMT
I am using ShowDialog to show a popup form and want to position the
popup relative to the control on the form the popup is pertinent to.
For this, I am using FormStartPosition.Manual to set the position of
the form relative to the desktop.

I can calc the location of a control relative to the client rect of a
form. But since I am positioning the popup form relative to the
desktop, I need to know the DesktopLocation of controls on the form.

thanks,
Thorsten Dittmar - 09 Sep 2007 22:25 GMT
Hi,

the Control class has a PointToScreen method which turns coordinates
expressed relative to the control's location into coordinates that are
relative to the top left corner of the desktop.

Thorsten

Steve Richter schrieb:
> I am using ShowDialog to show a popup form and want to position the
> popup relative to the control on the form the popup is pertinent to.
[quoted text clipped - 6 lines]
>
> thanks,
Steve Richter - 09 Sep 2007 22:27 GMT
nevermind, got it.  PointToScreen and PointToClient. very nice.

> I am using ShowDialog to show a popup form and want to position the
> popup relative to the control on the form the popup is pertinent to.
[quoted text clipped - 6 lines]
>
> thanks,

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.