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.