LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Pre-select a button

Solved!
Go to solution

Hello everyone,

 

I would like that when I display a new panel with several buttons, the button that I decide is the one to be pre-selected, so that when I press space bar this button and not the others is activated.

Does anyone know what ATTRIBUTE should I use or how to do it?

 

pre-selected button - Google Search - Google Chrome_2015-08-28_09-00-02.png

 

Thanks in advance!

0 Kudos
Message 1 of 3
(4,092 Views)
Solution
Accepted by josete

Hello josete!

 

The control which is highlighted (i.e. preselected) on a LabWindows/CVI panel, is the currently active control. You can change the active control to a different one (e.g. a different button) by calling the SetActiveCtrl function:

SetActiveCtrl (panelHandle, controlID);

You can also query the currently active control be calling the correspondent GetActiveCtrl function.

 

Regards!

- Johannes

Message 2 of 3
(4,088 Views)

The control that is active at panel load can be determined also while developing the UI: when the panel is selected in the editor press Ctrl+T to display a separate page where you can set the order of the controls.

 

After setting the order of controls this way, every time you load and display the panel the active control will be the one set with index 0 in that function. Operator can pass to next control with tab key: controls are scanned in the order set there.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 3
(4,071 Views)