chlroam:定义成int变量不就行了吗?
(发表于2004-7-29 9:57:00)
zyj800503:(1)
#define CTRL_C 0x3
#define CTRL_V 0x16
#define CTRL_X 0x18
(2)
void CUINTEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// TODO: Add your message handler code here and/or call default
if ((m_strValidChars.IsEmpty()) || ((-1 != m_strValidChars.Find(static_cast
(nChar))) ||
(nChar == VK_BACK) || (nChar == CTRL_C) || (nChar == CTRL_V) || (nChar == CTRL_X)))
{
CEdit::OnChar(nChar, nRepCnt, nFlags);
}
else
{
MessageBeep(MB_ICONEXCLAMATION);
return;
}
}
(3)m_strValidChars = "0123456789";
New a class named CUINTEdit based on CEdit.Add vitrul function OnChar().Using CUINTEdit construct your editctrl ,you can prevent from chars which are not in m_strValidChars .When you type a char which is not in m_strValidChars,the class will prompt using the statement"MessageBeep(MB_ICONEXCLAMATION);".You can use your promption instead of MessageBeep(MB_ICONEXCLAMATION);
(发表于2005-1-9 21:46:00)
zhangzhongbao:
掌中技术论坛,各位兄弟姐妹帮忙顶一下, 多多支持小弟。大家顺便帮我提点意见
,发布一些技术文章,也可以免费下载相关资料,大家互相交流、学习。有需要行
情连接的,也可以跟我联系,谢谢.
(发表于2008-7-7 11:27:00)
..........................................................................
--------------------next---------------------
阅读(151) | 评论(0) | 转发(0) |