Location of a control relative to form edges?

G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top