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,