LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically setting the Toggle Key?

Solved!
Go to solution
I want to programmatically change the Toggle Key settings for a Boolean control. I can easily use the server property ToggleKeyBind to revoke any settings (by creating a default constant), but try as I might, I can't work out how to set the Return Key to the Toggle. If I use '\n' to insert a return character key, I get an error: "Error 15, Resource Not Found." I just cannot figure out how to programmatically set the Return Key as the Toggle setting. Does anyone know how to do this?

Thanks in advance for everyone's suggestions.
Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 1 of 4
(3,892 Views)
Solution
Accepted by topic author Thoric
Is there anything unclear in the online help? (see bleow) 😄
 
Use the exact string "<Enter>" and things will work. Try it!
 


Message Edited by altenbach on 06-28-2008 03:40 PM
0 Kudos
Message 2 of 4
(3,889 Views)
Wow. Do I feel stupid now? Certainly do! Smiley Very Happy
Thanks altenbach!

Oh, is there a way to use, for example, Alt and 'C' as a toggle key ?? I want some buttons to have an underlined character in their captions to highlight that a certain key is a toggle key, but I'd like to add ALT as a modifier too. Can't see a way to use ALT or the use a keyboard character as a toggle button...


Message Edited by Thoric on 06-29-2008 12:43 PM
Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 3 of 4
(3,870 Views)

Not in this fashion (that I know of).

To catch the Atl-key you could build a menu with _keys and declare them in the menu item name.  Place an underscore in front of the letter you want underlined.

The ALT key is registered as a system key on Windows platforms.  All system keys, regardless of OS, are sent to the OS and LabVIEW does not ever get the message. 

Have a look at Khalid's example and some other examples in this thread.

He makes a call to the Windows API to intercept the ALT key press. 

RayR

0 Kudos
Message 4 of 4
(3,857 Views)