在编辑框种只能输数字,按字符无效,输入汉字提示!
请给出源代码?高分相送!

解决方案 »

  1.   

    在编辑框的属性页里有啊
    选上'number',就可以了
      

  2.   

    FloatEdit_demo.zip
    http://www.programsalon.com/download.asp?type_id=69&pos=20
      

  3.   

    重载PreTranslateMessage(MSG* pMsg);
    BOOL CYourDlg::PreTranslateMessage(MSG* pMsg) 
    {
    switch(pMsg->message)
    {
    case WM_CHAR:
    {
    HWND portHwnd = GetDlgItem(IDC_PORT)->GetSafeHwnd();
    if (pMsg->hwnd == portHwnd )
    {
    //long lp = pMsg->lParam;
    long wp = pMsg->wParam;
    if (wp == 8)     // Back Space clicked
    return CDialog::PreTranslateMessage(pMsg);
    if (wp > '9' || wp < '0')
    {
    MessageBox("Please input a number");
    return TRUE;  // do nothing if not a numeric
    }
    }
    }
    }
    return CDialog::PreTranslateMessage(pMsg);
    }
      

  4.   

    在编辑框的属性页中选上'number'