how calc the DesktopLocation of a control on a Form?

  • Thread starter Thread starter Steve Richter
  • Start date Start date
S

Steve Richter

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,
 
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
 
Back
Top