LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can the position of a control or indicator on the front panel be changed progamatically ?

I want to creat a number of buttons and make them visible and position them as needed in the application.
0 Kudos
Message 1 of 12
(4,258 Views)
I'm not sure about changing the position, but you can make the visible/invisible by using a property node.


Right click> Create>Property Node

Then Right click on the node and click "Change to Write"

Thenk you can write True or False to it to make it appear/dissapear.

Are you looking to change the position of the button/control depending on the function within the vi? You may have to use seperate controls (making the ones you don't want invisible) to make this occur. Someone else may be able to help better!
0 Kudos
Message 2 of 12
(4,258 Views)
You can do this by using "position� with a property node associated with the control.
0 Kudos
Message 3 of 12
(4,258 Views)
If you know the maximum number of buttons you'll need, the easiest thing to do is to create them all on the front panel, then manipulate the Visible and Position properties as Evan and seanpatrick have said.

If you want to create a control programatically, that gets a lot messier. Look at the discussions here.
0 Kudos
Message 4 of 12
(4,258 Views)
Here is a small example vi. I remembered that position was a property shortly after my original answer!
0 Kudos
Message 5 of 12
(4,258 Views)
Making buttons move is my thing. Attached you will find VIs that make advanced use of the postion property.
Message 6 of 12
(4,258 Views)
Man, you are having too much fun! I think Labview is fun, but none of my programs make me laugh. Thanks!

One interesting thing on a more technical note: The speed of your flying boolean is affected by the size of the window. If you maximize the window, the flying noticably slows down. If you reduce the size of the window, it really speeds up. I guess it's something inefficient in the way Labview or Windows redraws the window: a lot more is getting redrawn than just the area that changed.
0 Kudos
Message 7 of 12
(4,258 Views)
I am glad you liked them. The folks around the office had a real hoot too.

I am not sure how LabVIEW refreshed the screen in the event cannon. I am sure there are several places I could improve the performance of my algorithm. I have been meaning to add code to programatically determine where the LED will be for its entire flight when the mouse button is clicked. This way I could add more target buttons and tell which button will be hit. This should speed up the code and add much flexibility. I wanted to call the additional code the LabVIEW game engine. So many plans, so little time...
0 Kudos
Message 8 of 12
(4,258 Views)
can someone please 6.0.2 these?

Paul.S
0 Kudos
Message 9 of 12
(4,258 Views)
Two of these use event structures not available in LV 6.0.2, but one of them is possible to transliterate. This is actually a rebuild of the code, apologies to Mr. Braden, I've attempted to make no changes to it's structure.

Why didn't I just save a prior version from 6.1? It's a long story...
0 Kudos
Message 10 of 12
(4,258 Views)