Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 681
  • 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
 
Norman MainaCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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