473,407 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Location of a control relative to form edges?

Hello,

I have a control that is inside a GroupBox, and that GroupBox is inside
another group box. I would like to find the location of the control relative
to the form itself. When I examine the Location of the control, it is
relative to the containing GroupBox, and the Location of that GroupBox is
relative to its containing GroupBox. Only the location of the outermost
GroupBox is relative to the edges of the form itself. So, what I've been
doing is simply adding the coordiantes of all these together to get what I
need. However, this isn't a good solution since I may want to remove/add
containing GroupBoxes, thereby necessitating code changes. Is there a clean
way to just get the Location of any control relative to the edges of the form
itself?

Thanks,
Ray
Aug 20 '07 #1
1 3211
take a look at PointToScreen and PointToClient

Aug 21 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Catherine Lynn Wood | last post by:
I need to know how to overlap DIV content within 'relative' associated rendering. I am building div layers in the middle of a page and when I set positioning to absolute in the CSS, it references...
1
by: steve bull | last post by:
I have a picture box which lies on a panel which lies on a form. Is there some way that I can calculate the position of the picture box relative to the form rather than the panel on which it lies?...
1
by: JJ | last post by:
Hi, I am buidling some controls dynamically in the .cs file, context menu. I am wondering if there is any chance I could obtain the location of any controls and set the location of another...
1
by: Colin McGuire | last post by:
Thanks everyone for help in my previous post. Using the "Point.op_Addition" from the previous post I have to now focus on the real problem. I need to manually position a new form so that its...
4
by: Strahimir Antoljak | last post by:
I want to track the cursor location relative to a control on the form. I am aware of System.Windows.Forms.Cursor.Position which provides absolute cursor position relative to the screen. With right...
11
by: herman404 | last post by:
Hi everyone, I have a DataGrid that displays data on a dialog application. When the dialog is resized, the datagrid keeps the same shape, We would need the datagrid to keep a relative shape...
5
by: Jon Slaughter | last post by:
Is there a way to get a controls location in screen coordinates? (not relative to the container it is in)? Thanks, Jon
0
by: Claes Wedin | last post by:
We had a BaseForm with some code that we inhereted for new forms from by simply changing ": Form" to ": BaseClasses.BaseForm". There were no problems... Then we added a Cancel and a Save button to...
2
by: ducttape | last post by:
Hello I'm busy working with an MDI parent and child forms. I've found that there is a discrepancy between the locations returned by DesktopLocation, Control.MousePosition and MouseEventArgs...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.