LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I programmatically switch on and off a toolbar button ?

I use the toolbar.fp instrument.

In this toolbar I have 2 exclusive toggle buttons which are linked to 2 menu callbacks.

All I want to do is toggle one of those buttons (as if it was clicked) when one use the menu bar alternative.
This way, the toggle buttons reflect the last user's action on the menu bar.

Another question on the this topic : is it possible to change the vertical position of the separators to have them vertically centered when if office97 style?

thanks,
Sylvain.
0 Kudos
Message 1 of 5
(3,463 Views)
You can use a set of exclusive toggle buttons. When you choose one button to be on (1), all the other buttons in the set will be turned off (0). Here is an example that demonstrates how to create a set of exclusive toggle buttons.

http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3DB7F56A4E034080020E74861&p_node=DZ52148&p_submitted=N&p_rank=&p_answer=&p_source=External

Mika Fukuchi
Application Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,463 Views)
I don't think you have understood my request. I want to toggle BY SOFTWARE an exclusive toggle buttons.
For ex, let's say that I want it to toggle when I click a button.
0 Kudos
Message 3 of 5
(3,463 Views)
You can call Toolbar_SetItemVal function on one button in a set of exclusive toggle buttons, and set the value to 1, and that will automatically set the values of other buttons in the set to 0.
0 Kudos
Message 4 of 5
(3,463 Views)
Thanks a lot, that works great.
I'm new to CVI and I should have read the tollbar instrument's help more carefully!
Once again thanks.
0 Kudos
Message 5 of 5
(3,463 Views)