Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OnChar

Status
Not open for further replies.

HyperEngineer

Programmer
May 8, 2002
190
US
I am using Visual Studio 2008 Standard. The OnChar() function for the dialog box does not exectute. I have two edit boxes and some buttons on the dialog box. How do I get the dialog box itself to have the focus so that the OnChar() function for the dialog box executes? Otherwise, I will have to subclass the edit boxes to override their OnChar() functions.

HyperEngineer
If it ain't broke, it probably needs improvement.
 
I'm wondering why you want to do this. Do you need extra accelerator keys?

Do you have shortcuts (underlined letters) in the text labels for the edit boxes and buttons? Do you have WS_GROUP set in the styles for the appropriate controls? Are your controls in the correct order (check with Layout tool)? Do you have WS_TAB on the controls you want to tab between? Does one of your push buttons have the WS_DEFAULT style?

I think the character handling for a dialog is all done internally, to handle the normal accelerators and only mistakes (such as Alt+some character which is not a shortcut for any control on the dialog) would actually be sent to the OnChar routine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top