How to find the "real" screen position of a control

S

Simon Verona

I have a usercontrol which when entered pops up a form. I want the form to
be aligned with the bottom edge of the user control.

I was doing this by passing the usercontrol into the form as a parameter and
using the left and top properties to find the location on the screen to
position the form. However, these are relative to the container
(panel/form/tabcontrol etc).

How can I best locate or pass the actual screen coordinates of my user
control into the form?

Thanks
Simon
 
S

Simon Verona

Ok, I found the answer, just in case anybody else wants to know.

For a control, to find the screen coordinates of the top left of the control
use :

Dim ScreenPos as point=me.PointToScreen(new point(0,0))

Regards
Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top