在一个对话框中加载了一个加速键资源,IDC_0--->IDC_9,对应小键盘上的0---->9.
输入数字并在对话框中显示,当我输入的时候出问题了,显示的数字都比输入的小1,而输入1的时候没反应..不知道哪里错了,大家帮忙下,谢谢了
BOOL CTonDlg::PreTranslateMessage(MSG*pMsg)
{
if(m_haccel!=NULL)
if(::TranslateAccelerator(m_hWnd,m_haccel,pMsg))return TRUE;
return CDialog::PreTranslateMessage(pMsg);}
void CTonDlg::updatadispaly()  //显示
{
CClientDC dc(this);
CRect rect=m_rect;
rect.InflateRect(-2,-2);
CSize size=dc.GetTextExtent(m_strdisplay);
int x=rect.right-m_cxchar-size.cx;
int y=rect.top+((rect.Height()-m_cychar)/2);
dc.ExtTextOut(x,y,ETO_OPAQUE,rect,m_strdisplay,NULL);
}
void CTonDlg::OnDigit(UINT nID) 处理数字输入,把输入的数字加入到输出字符串中
{
TCHAR num=(char)nID;
m_strdisplay+=(num-IDC_0+0x30);
         updatadispaly();
}