Working with CBitmapButton

Hi! I have some CBitmapButton's associated with icons, depending on each button state. For example an icon when the button is up, another when it's down. The icons associated refer to numbers like a keypad. What I'd like to do is, interacting with the keyboard, to make the button associated with number one appear in down state when I press number one in the keyboard, and when I release it it should go back to the normal up state. Is that possible? Can I force a button's state? Thanks!
[509 byte] By [azzazzel82] at [2007-11-19 7:10:03]
# 1 Re: Working with CBitmapButton
What type of application you working with dialog based ya Document view based.

i think you cant overide key bord event in a dialog based applicatio if you have controls in your dialog.

in that case you can try for pretranslate message. get the key down and key up events and process what you want to do with them

LIKE

BOOL CTestDlg :: PreTranslateMessage ( MSG* pMsg ) {

if ( pMsg->message == WM_KEYDOWN ) TRACE ( "\n\n KEY DOWN" );
else if ( pMsg->message == WM_KEYUP ) TRACE ( "\n\n KEY UP" );

return CDialog::PreTranslateMessage(pMsg);
}

you can check the key values also here
Vinod S at 2007-11-11 0:28:24 >