LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Use ENTER keypress to close panel

I have an OK button on a panel that does some processing of the data entered within the other controls and closes the panel. I would like the panel to have the same look and feel as a Windows panel in that when ENTER is pressed, no matter what control is selected, the OK button event is carried out.
0 Kudos
Message 1 of 3
(2,741 Views)
To do that, all you have to do is assign the ENTER key to the OK button as a shortcut key. You can do that when you edit the command button in the UI editor, or you can do it programmatically with the following call:

SetCtrlAttribute (panel, control, ATTR_SHORTCUT_KEY,VAL_ENTER_VKEY);

Luis
NI
Message 2 of 3
(2,741 Views)
Of course! Thanks for that.
0 Kudos
Message 3 of 3
(2,741 Views)