Solved

How to tell teh absolute position of a control

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

864 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

24 Experts available now in Live!

Get 1:1 Help Now