Solved

How to tell teh absolute position of a control

Posted on 2010-08-21
4
664 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now