Sign in to follow this  
Followers 0
DarkBoost

Buttons displaying "_" for visual hotkey

3 posts in this topic

I have a GUI with a Save Button and have set a Hotkey so when the user will press CTRL + S it will run the Function associated with this.

I added &Save so that there is an underscore below the S and in test mode this will be displayed but then fails to display when running the compiled EXE.

Any ideas what is happening ?

Example:

HotkeySet("(^s)", "_save"); user press CTRL + S to execute _save function

GUICtrlCreateButton("&Save", 20, 20, 50, 20); display button with underscore below letter "S"

Share this post


Link to post
Share on other sites



Any ideas what is happening ?

Well, since you haven't provided enough of your script to reproduce the problem, and since the following code works, I dunno, it must be something else?

HotKeySet("^s", "_save"); user press CTRL + S to execute _save function

GUICreate("test")
GUICtrlCreateButton("&Save", 20, 20, 50, 20); display button with underscore below letter "S"
GuiSetState()

Do
    Sleep(10)
Until GuiGetmsg() = -3

Func _save()
    MsgBox(0, "", "Save")
EndFunc

PS: Your HotKeySet() statement is malformed: you don't need the brackets inside the quotes. "^s" not "(^s)"

Share this post


Link to post
Share on other sites

Through various tests have discovered that the underscore is designed with the Menu Items in mind rather than the Buttons as the underscore only appears to be displayed for me in the Complied EXE when the user clicks ALT which generally is how users will access the Menu Items. So a work around is I send({ALT}) after the buttons have been created and problem solved.

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