L
Landon
I use VC++ MFC 4.2.
I have a few MULTILINE CEdits.
If user press Enter key on one of the CEdit then it will act like Tab key
which is going to change focus to other CEdit.
If user press Ctrl + Enter, then it will act like Enter key in a notepad
which is going to a NEW line.
How to do that?
I have tried this code but if I press Ctrl + Enter, it acts like Tab. I was
confused.
Thank you.
BOOL CEditEx:reTranslateMessage(MSG* pMsg)
{
// TODO: ã“ã®ä½ç½®ã«å›ºæœ‰ã®å‡¦ç†ã‚’è¿½åŠ ã™ã‚‹ã‹ã€ã¾ãŸã¯åŸºæœ¬ã‚¯ãƒ©ã‚¹ã‚’呼ã³å‡ºã—ã¦ãã ã•ã„
if( pMsg->message == WM_KEYDOWN ){
if( pMsg->wParam == 11 && pMsg->wParam == 13 )
return CEdit:reTranslateMessage(pMsg);
else if( pMsg->wParam == 13 ) //13: ENTER KEY
pMsg->wParam = 9; // 9: TAB KEY
}
return CEdit:reTranslateMessage(pMsg);
}
I have a few MULTILINE CEdits.
If user press Enter key on one of the CEdit then it will act like Tab key
which is going to change focus to other CEdit.
If user press Ctrl + Enter, then it will act like Enter key in a notepad
which is going to a NEW line.
How to do that?
I have tried this code but if I press Ctrl + Enter, it acts like Tab. I was
confused.
Thank you.
BOOL CEditEx:reTranslateMessage(MSG* pMsg)
{
// TODO: ã“ã®ä½ç½®ã«å›ºæœ‰ã®å‡¦ç†ã‚’è¿½åŠ ã™ã‚‹ã‹ã€ã¾ãŸã¯åŸºæœ¬ã‚¯ãƒ©ã‚¹ã‚’呼ã³å‡ºã—ã¦ãã ã•ã„
if( pMsg->message == WM_KEYDOWN ){
if( pMsg->wParam == 11 && pMsg->wParam == 13 )
return CEdit:reTranslateMessage(pMsg);
else if( pMsg->wParam == 13 ) //13: ENTER KEY
pMsg->wParam = 9; // 9: TAB KEY
}
return CEdit:reTranslateMessage(pMsg);
}