-
October 10th, 2004, 05:09 AM
#1
accelerators to bitmap buttons
hello
how can i add accelerators to CBitmapButton object?
-
October 10th, 2004, 05:18 AM
#2
Re: accelerators to bitmap buttons
You can add accelerators to commands, which will be sent to window that owns accelerator. And you can define a command, add it to accelerator list and in its handler send pushing message to your button.
"Programs must be written for people to read, and only incidentally for machines to execute."
-
October 10th, 2004, 05:42 AM
#3
Re: accelerators to bitmap buttons
plaese explaine with a bit of code..............
-
October 10th, 2004, 07:10 AM
#4
Re: accelerators to bitmap buttons
Go to accelerator editing window. Add accelerator, entering to ID field any yet undefined identifier that you wish to correspond with your message. VS defines that ID for you. Then if you use wizardry add a message handler to that ID to your (dialog?) window that owns accelerator. Otherwise add smth like ON_COMMAND(ADD_YOUR_ID_HERE,OnMyID) to the message map and OnMyID function to the class (change names of function and ID to smth that fits). In that handler handle the message. In the handler of button pushing add
Code:
PostMessage(ADD_YOUR_ID_HERE);
to redirect handling to the handler of your message. You can use othe redirect, from command handler to button pushing handler, but it is unconvenient.
"Programs must be written for people to read, and only incidentally for machines to execute."
-
October 10th, 2004, 07:57 AM
#5
Re: accelerators to bitmap buttons
Just add & before a letter in a button text that will serve as an accelerator: B&utton for example.
Pressing Alt-u will invoke this accelerator and button’s handler will be called.
There are only 10 types of people in the world:
Those who understand binary and those who do not.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|