LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

position of control

Solved!
Go to solution

Hi All,

I need to know the position of the control on the front panel wrt the screen and not the panel. Currently if I have a graph on a FP and I use the property "Position", it returns the top and the left poisiton of the control wrt the panel. I need the position of the control on the screen and not the panel.

How can I get that information?

 

Thanks,

Ritesh

0 Kudos
Message 1 of 5
(3,587 Views)
Solution
Accepted by topic author LVCoder

You need to take the position of the front panel (use the FP panel bounds) and then take the position of the control so add both the top and the left values of the positions, there you go you got the position of the control with respect to screen.

 

Note: While doing this keep the origin of the FP left and top exactly meeting the panel edges so that you can get the actual position.

-----

The best solution is the one you find it by yourself
Message 2 of 5
(3,580 Views)

Here's a snippet of some code I had.  This code was used to click a control using Windows calls.  I knew where the controls were on the front panel, so those are the constants.  But this should get you 90% there.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 5
(3,550 Views)

Ok, I believe to get the actual position of the controls, I have to set the position of the panel to (0,0) and keep the edges of the window also to (0,0). And if I don't set these positions before hand, it won't be possible to get the acutal position of the control.

 

Thanks!

0 Kudos
Message 4 of 5
(3,538 Views)

You can use this.  Unfortuneately it can cause a flicker when it runs because it has to briefly hide the menubar and the toolbar.  If it didn't, the vertical coordinate would be off by an amount equal to the height of the menubar + toolbar.

Download All
0 Kudos
Message 5 of 5
(3,529 Views)