Solved

How to tell teh absolute position of a control

Posted on 2010-08-21
4
671 Views
Last Modified: 2012-05-10
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
Comment
Question by:DRRobinson
4 Comments
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 500 total points
ID: 33492707
Dim ScreenPos as point=thecontrol.PointToScreen(new point(0,0))
0
 
LVL 12

Expert Comment

by:NormanMaina
ID: 33492741
check this out on other things you can do:
http://vbcity.com/forums/p/3492/16815.aspx
0
 
LVL 6

Expert Comment

by:ksrsrinivasan
ID: 33492766
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
 

Author Closing Comment

by:DRRobinson
ID: 33492990
Works perfect.. thanks..
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question