08-28-2015 02:01 AM
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?
Thanks in advance!
Solved! Go to Solution.
08-28-2015 02:40 AM - edited 08-28-2015 02:40 AM
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
08-28-2015 11:04 AM
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.