|
|
|
MFC FAQ SNEAK PEEK #1 Our exclusive preview of Scot Wingo's upcoming additions
Q. How do I filter characters in a CEdit? A. Create a CEdit derivative (CMyEdit) and create an OnChar() message map entry.
// Assume that CMyEdit is derived from the CEdit class.
afx_msg void CMyEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if (nChar == 'a' || nChar == 'A')
{
nChar = 'X';
}
DefWindowProc(WM_CHAR, nChar, MAKELONG(nRepCnt, nFlags));
}
--Source Unknown
Comments? Speak up! | Past FAQ Tips | Latest FAQ Document | Home | |