LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I find the coordinates of individual controls inside a custom control?

I have a custom control that contains 44 smaller custom controls.
 
I can get the coordinates of the 44 embedded custom controls by getting the controls[] property of the main control, but I cannot find a way of getting the coordinates of the controls inside each of these smaller custom controls.
 
Is there a way of getting at the coordinates of custom controls that are nested several layers deep?
 
Erik.
0 Kudos
Message 1 of 4
(2,768 Views)

Hi Erik,

see the attached example. It searches for all reference, also this ones which are in other controls. After you have all references you can read the position of it. If this not help, please describe in more detail what you want.

Hope it helps.

Mike

0 Kudos
Message 2 of 4
(2,744 Views)

Mike,

That was EXACTLY what I was lloking for.  Thank you very much.

 

Erik.

0 Kudos
Message 3 of 4
(2,719 Views)

For future reference and for any LabVIEW users who have older versions here are the Front Panel displays before running the VI along with the Wiring Diagram with each of the four cases for handling the various types of ClassIDs that can contain child controls.  X1, X@, Y1, and Y2 are the coordinates of the top left and bottom right corners of each control.  These coordinates can then  be used to determine which control the mouse is pointing at.

In my own project I did further evaluation to eliminate all parent controls (controls that contain other controls) and passed along only the controls that were end-nodes (controls that contain no other controls). Also, the control's refnum was stored for later use.

The bottom picture shows the data gathered during the execution of this VI.

 

Thanks again, Mike!

 

0 Kudos
Message 4 of 4
(2,694 Views)