Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 679
  • Last Modified:

How to tell teh absolute position of a control

I have a form that has a text bos.  I'm tring to mimic the efffect of a drop down list box.  The list box is contained in another borderless form that I want to display aligned directly below the text box.  How can teh absolute postion be calculated for an object on a form.  Not the postion with a container, or a postion in relation to the form, but the postion in relationship to the screen display?
0
DRRobinson
Asked:
DRRobinson
1 Solution
 
cyberkiwiCommented:
Dim ScreenPos as point=thecontrol.PointToScreen(new point(0,0))
0
 
NormanMainaCommented:
check this out on other things you can do:
http://vbcity.com/forums/p/3492/16815.aspx
0
 
ksrsrinivasanCommented:
You can use the PointToScreen method to get the position for your borderless form. It could be somethig like
Point p = textBox1.PointToScreen(textBox1.Location); //textBox1.Location could replaced with a calculated position you want the form to be placed relative to the text box.

form1.Location = p;

Open in new window

0
 
DRRobinsonAuthor Commented:
Works perfect.. thanks..
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now