kevinbenedict
asked on
Default CButton doens't work when created programmatically
When I create a CButton using Create, and I set the style to BS_DEFPUSHBUTTON, the button doesn't receive the button click message when the user hits the enter key. It generates the OnOK message. When the button is created using the resource editor and the style is set to default button, everything works correctly. How do I make a button the default button when creating it programmatically? Do I have to determine the default myself by handling the DM_GETDEFID message? Is there a better way?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Be sure that no other buttons in the dialog have the BS_DEFPUSHBUTTON style
ASKER
This works great in Windows but not on a PocketPC for some reason. I am using eVC++ and am targeting mobile devices.