当前位置:首页 > VC++课程设计
科学计算器设计
CString s1,s2;
2利用ClassWizard为各按钮添加消息映射并默认给出的函数。 (1)代码如下: void CMyDlg::On0() { s2=s2+\ m_xx=m_xx+\ UpdateData(FALSE);
// TODO: Add your control notification handler code here }
void CMyDlg::On1() { s2=s2+\ m_xx=m_xx+\ UpdateData(FALSE);
// TODO: Add your control notification handler code here }
void CMyDlg::On2() {s2=s2+\
m_xx=m_xx+\ UpdateData(FALSE);
// TODO: Add your control notification handler code here }
void CMyDlg::On3() {s2=s2+\
m_xx=m_xx+\ UpdateData(FALSE);
// TODO: Add your control notification handler code here
- - 4 - -
科学计算器设计
}
void CMyDlg::On4() {
s2=s2+\
// TODO: Add your control notification handler code
m_xx=m_xx+\ UpdateData(FALSE); here }
void CMyDlg::On5() {s2=s2+\
m_xx=m_xx+\ UpdateData(FALSE);
// TODO: Add your control notification handler code here }
void CMyDlg::On6() {s2=s2+\
m_xx=m_xx+\ UpdateData(FALSE);
// TODO: Add your control notification handler code here }
void CMyDlg::On7() {
s2=s2+\
m_xx=m_xx+\
UpdateData(FALSE);// TODO: Add your control notification handler code here }
- - 5 - -
科学计算器设计
void CMyDlg::On8() {s2=s2+\
m_xx=m_xx+\ UpdateData(FALSE);
// TODO: Add your control notification handler code here }
void CMyDlg::On9() {
s2=s2+\
m_xx=m_xx+\
UpdateData(FALSE);// TODO: Add your control notification handler code here }
void CMyDlg::Onadd() { s2=\ s1=m_xx; m_xx=m_xx+'+'; str='+';
UpdateData(false); // TODO: Add your control notification handler code here }
void CMyDlg::Onbze() {s2=\ int i,len; char s;
len=strlen(m_xx); CString m_xx1; for(i=0;i - - 6 - - 科学计算器设计 m_xx1=m_xx1+\ break; case '2': m_xx1=m_xx1+\ break; case '3': m_xx1=m_xx1+\ break; case '4': m_xx1=m_xx1+\ break; case'5': m_xx1=m_xx1+\ break; case '6': m_xx1=m_xx1+\ break; case'7': m_xx1=m_xx1+\ break; } } m_xx=m_xx1; UpdateData(false); // TODO: Add your control notification handler code here } void CMyDlg::Oncheng() {s2=\ s1=m_xx; m_xx=m_xx+'*'; str='*'; UpdateData(false); // TODO: Add your control notification handler code here - - 7 - -
共分享92篇相关文档