Sign in to follow this  
Followers 0
LostUser

How do you create menu items that also use key combos?

6 posts in this topic

I am making windows and using some menu items where some have the under score so you can use that letter to execute that item. I would also like the option of being able to use a key combination like ctrl-s for save rather than going to File\Save and other things.

What I need to know basically is how do you get the key combo to display with menu item and allow it to actually be used.

I was thinking of just putting the key combo text in the menu along with the menu item text and doing a hotkeyset for whatever key combos I need to do. Is there another guictrl... way or do you just put it in the text and make the hotkeyset?

If that doesn't quite make sense I can try to explain further.


Be open minded but not gullible.A hammer sees everything as a nail ... so don't be A tool ... be many tools.

Share this post


Link to post
Share on other sites



Nothing to offer on this one either?


Be open minded but not gullible.A hammer sees everything as a nail ... so don't be A tool ... be many tools.

Share this post


Link to post
Share on other sites

Well, that makes sense. Menu item with the text for the shortcut and make the shortcut a hotkey.

Thanks for that link.


Be open minded but not gullible.A hammer sees everything as a nail ... so don't be A tool ... be many tools.

Share this post


Link to post
Share on other sites

I could have sworn there was a way to automatically tie the keys into the menu file by using the "pipe" command (|) at the end of your menu title. Example:

$mFile = GuiCtrlCreateMenu( '&File' )
$mFOpen = GuiCtrlCreateMenuItem( '&Open | CTRL+O', $mFile )
$mFClose = GuiCtrlCreateMenuItem( '&Close | ALT+F4', $mFile )

"...Yes, I am a criminal. My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like.My crime is that of outsmarting you, something that you will never forgive me for." --The Mentor"Mess with the best, die like the rest!!" -Hackers"This above all to thine own self be true." -William Shakespeare"Corruption is only as corrupted as the individual makes it out to be." -Mozart_ONLINECheck out this free 1 GB FTP website at DriveHQ.com. You can control the users and even publish a website for free!![s]Your-Start.com - A online website that you can customize to hold all you links, news information, and other website info.[/s]

Share this post


Link to post
Share on other sites

I could have sworn there was a way to automatically tie the keys into the menu file by using the "pipe" command (|) at the end of your menu title. Example:

$mFile = GuiCtrlCreateMenu( '&File' )
$mFOpen = GuiCtrlCreateMenuItem( '&Open | CTRL+O', $mFile )
$mFClose = GuiCtrlCreateMenuItem( '&Close | ALT+F4', $mFile )
I tried doing that and it doesn't seem to work. I tried separating the Pipe command in different ways, using Ctrl+S in quotes, out of quotes, with {} brackets. None works yet. The only thing I can get to do it so far is the HotKeySet command...which is fine I suppose.

Be open minded but not gullible.A hammer sees everything as a nail ... so don't be A tool ... be many tools.

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