Fran Posted November 1, 2010 Posted November 1, 2010 Hi,I would like to know how to assign 'hotkey' letters to buttons, so that the text is also underlined on the button.Example: Next >Just by pressing 'N', the button is activated.I've searched in the help files and on the forums, but can't find anything. Maybe I'm searching using the wrong keywords?Any help would be appreciated.Thanx!F
martin Posted November 1, 2010 Posted November 1, 2010 Hi,I would like to know how to assign 'hotkey' letters to buttons, so that the text is also underlined on the button.Example: Next >Just by pressing 'N', the button is activated.I've searched in the help files and on the forums, but can't find anything. Maybe I'm searching using the wrong keywords?Any help would be appreciated.Thanx!FPut an ampersamd before the letter you want to use. If you need to have an ampersand in the caption then put 2 to get 1 shown. I Assume that if you want an ampersand as the hot key then you put 3 but I've never tried.Eg&Nextwill show as NextNe&xtwill show as NextThis is a standard Windows feature and is the same for any language. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Fran Posted November 1, 2010 Author Posted November 1, 2010 Thanx Martin! I have done what you said, but it doesn't work every time. $but1 = GUICtrlCreateButton("&Next >", 326, 325, 74, 23, $BS_DEFPUSHBUTTON) Sometimes the 'N' is underlined and sometimes it's not (although the 'hotkey' "n" always works) Another thing... on the next screen I change my button: GUICtrlSetData($but1, 'I &Agree >') But the 'A' is not underlined and it also doesn't work if I just push "a" on the keyboard. Weird... F
Fran Posted November 1, 2010 Author Posted November 1, 2010 (edited) ok... if i click around a bit (next, back, next, back), the letters get underlined (strange), and even though the "a" doesn't work, if I press alt + 'a' or alt + 'b' (for the back button) it works. I'll check again when I've compiled the script what happens. Thanx again for the help! F Edited November 1, 2010 by Fran
Mat Posted November 1, 2010 Posted November 1, 2010 They are usually underlined when you press the 'alt' key. There is a setting somewhere to make them always shown... AutoIt Project Listing
Fran Posted November 1, 2010 Author Posted November 1, 2010 They are usually underlined when you press the 'alt' key. There is a setting somewhere to make them always shown... Learnt something new today
Mat Posted November 1, 2010 Posted November 1, 2010 Learnt something new today I found the setting at long last... I'm sure it was easier to find on xp (I'm on vista now).Control Panel ==> Ease of Access ==> Make the keyboard easier to use ==> Underline keyboard shortcuts and access keysUsually it's not ticked, and the underline is only shown when you press the Alt key.Maybe that will be something people like to tick, I might leave it on for now.Mat AutoIt Project Listing
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now