16,466
社区成员
发帖
与我相关
我的任务
分享
BOOL CDlg3Dlg::OnCommand(WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
UINT uNotify = HIWORD(wParam);
UINT uID = LOWORD(wParam);
if(uNotify == EN_KILLFOCUS)
{
for(int i=0; i<_countof(uIDCCode); i++)
{
if(uID != uIDCCode[i])
continue;
CEdit *pEdit = (CEdit *)GetDlgItem(uID);
if(pEdit == NULL)
continue;
CString szItem;
pEdit->GetWindowText(szItem);
//添加判断和处理
}
}
return CDialog::OnCommand(wParam, lParam);
}
static const UINT uIDCCode[] =
{
IDC_Code1, IDC_Code2, xxxxx
};
for(int i=0; i<min(_countof(uIDCCode), _countof(m_Code)); i++)
{
DDX_Text(pDX, uIDCCode[i], m_Code[i]);
}
[/quote
好的。谢谢。那请问怎么实现我这24个控件输入的值的判定呢?我需要输入一个控件时就去比较是否跟之前的重复,而且如果输入的值只能是15位的数值和字母的组合?这个要怎么设计呢?static const UINT uIDCCode[] =
{
IDC_Code1, IDC_Code2, xxxxx
};
for(int i=0; i<min(_countof(uIDCCode), _countof(m_Code)); i++)
{
DDX_Text(pDX, uIDCCode[i], m_Code[i]);
}