Sign in to follow this  
Followers 0
Fran

Button 'hotkey' underline text

7 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Put 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

&Next

will show as Next

Ne&xt

will show as Next

This 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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by Fran

Share this post


Link to post
Share on other sites

They are usually underlined when you press the 'alt' key. There is a setting somewhere to make them always shown...

Share this post


Link to post
Share on other sites

They are usually underlined when you press the 'alt' key. There is a setting somewhere to make them always shown...

:graduated: Learnt something new today :(

Share this post


Link to post
Share on other sites

:graduated: 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 keys

Usually 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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0