CBitmapButton not taking keyboard inputs.
-
Hi, I have changed the normal dialog button to owner draw and used CBitmapButton. But when the focus is on the button and when we hit enter it is not taking the keyboard input. When we remove the owner draw, keyboard input works. Can someone let me know how to enable keyboard input when the button is Owner draw and use CBitmapButton to place image on it. Thanks in advance.. Ram..
-
Hi, I have changed the normal dialog button to owner draw and used CBitmapButton. But when the focus is on the button and when we hit enter it is not taking the keyboard input. When we remove the owner draw, keyboard input works. Can someone let me know how to enable keyboard input when the button is Owner draw and use CBitmapButton to place image on it. Thanks in advance.. Ram..
Is the control recieving a WM_KEYDOWN when you bash enter when the focus is on it? From what I remember of using BS_OWNERDRAW controls years ago you have to handle the keyboard messages yourself. Unlike BS_PUSHBUTTON the control doesn't generate BN_CLICKED notifications from someone pressing return/enter or space. My first line of enquiry would be to override OnKeyDown in the button class and see what happens. If that's called then override OnKeyUp and send the button's parent a WM_COMMAND/BN_CLICKED when the enter or space key are released. Cheers, Ash
modified on Monday, September 20, 2010 11:39 AM