troubleshooting Question

Problem creating accelerators and setting focus to the MFC model dialog.

Avatar of a_k_
a_k_ asked on
System Programming
4 Comments1 Solution312 ViewsLast Modified:
I created MFC Model Dialog box with dynamically created buttons. I created buttons in the OnInitDialog and add the mnemonic-prefix character (&) to the caption string of each button in order to create accelerator keys, and then I put focus at the first button. When I activate the application using keyboard the focus appear on the first button and each button has underline character associated with the accelerator key, but when I activate the application using mouse - focus does not appear on the dialog and buttons does not have any underline characters at the captions (actually dialog acts like focus is at the first button and the functionality of the accelerator buttons works too).
I tried to repaint the dialog but it did not help.
What can cause this problem? May be in order to put accelerators to the buttons I have to add some additional code and “&” character are not enough?
Thank you in advance for you help.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros