// 加法程序Dlg.cpp : implementation file
//
#include "stdafx.h"
#include "加法程序.h"
#include "加法程序Dlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyDlg dialog
CMyDlg::CMyDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMyDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CMyDlg)
m_num1 = 0;
number3= 1;
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CMyDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMyDlg)
DDX_Text(pDX, IDC_EDIT1, m_num1);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
//{{AFX_MSG_MAP(CMyDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
ON_BN_CLICKED(IDC_BUTTON4, OnButton4)
ON_BN_CLICKED(IDC_BUTTON5, OnButton5)
ON_BN_CLICKED(IDC_BUTTON6, OnButton6)
ON_BN_CLICKED(IDC_BUTTON7, OnButton7)
ON_BN_CLICKED(IDC_BUTTON8, OnButton8)
ON_BN_CLICKED(IDC_BUTTON9, OnButton9)
ON_BN_CLICKED(IDC_BUTTON10, OnButton10)
ON_BN_CLICKED(IDC_BUTTON11, OnButton11)
ON_BN_CLICKED(IDC_BUTTON12, OnButton12)
ON_BN_CLICKED(IDC_BUTTON13, OnButton13)
ON_BN_CLICKED(IDC_BUTTON14, OnButton14)
ON_BN_CLICKED(IDC_BUTTON15, OnButton15)
ON_BN_CLICKED(IDC_BUTTON18, OnButton18)
ON_BN_CLICKED(IDC_BUTTON16, OnButton16)
ON_BN_CLICKED(IDC_BUTTON17, OnButton17)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyDlg message handlers
BOOL CMyDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
}
void CMyDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CMyDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CMyDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CMyDlg::OnButton1()
{
if(minus_judge==1)
{
// TODO: Add your control notification handler code here
MessageBox("您好,负号输入后不可连续输入数字!");
}
else
{
UpdateData(TRUE);//按钮"1的"程序
if (number3==1)
{
if (m_num1==0)
{
m_num1= 1;
numble1=m_num1;
UpdateData(FALSE);
}
else
{
m_num1=m_num1*10+1;
numble1=m_num1;
UpdateData(FALSE);
}
}
else
{
if (m_num1==0)
{
m_num1= 1;
numble2=m_num1;
UpdateData(FALSE);
}
else
{
m_num1=m_num1*10+1;
numble2=m_num1;
UpdateData(FALSE);
}
}
}
}
void CMyDlg::OnButton2()
{
if(minus_judge==1)
{
// TODO: Add your control notification handler code here
MessageBox("您好,负号输入后不可连续输入数字!");
}
else
{
UpdateData(TRUE);
if (number3==1)
{
if (m_num1==0)
{
m_num1= 2;
numble1=m_num1;
UpdateData(FALSE);
}
else
{
m_num1=m_num1*10+2;
numble1=m_num1;
UpdateData(FALSE);
}
}
else
{
if (m_num1==0)
{
m_num1= 2;
numble2=m_num1;
UpdateData(FALSE);
}
else
{
m_num1=m_num1*10+2;
numble2=m_num1;
UpdateData(FALSE);
}
}
}
}
void CMyDlg::OnButton3()
{
if(minus_judge==1)
{
// TODO: Add your control notification handler code here
MessageBox("您好,负号输入后不可连续输入数字!");
}
else
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
if (number3==1)
{
if (m_num1==0)
{
m_num1= 3;
numble1=m_num1;
UpdateData(FALSE);
}
else
{
m_num1=m_num1*10+3;
numble1=m_num1;
UpdateData(FALSE);
}
}
else
{
if (m_num1==0)
{
m_num1= 3;
numble2=m_num1;
UpdateData(FALSE);
}
else
{
m_num1=m_num1*10+3;
numble2=m_num1;
UpdateData(FALSE);
}
}
}
}
void CMyDlg::OnButton4()
{
if(minus_judge==1)
{
// TODO: Add your control notification handler code here
MessageBox("您好,负号输入后不可连续输入数字!");
}
else
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
if (number3==1)
{
if (m_num1==0)
{
m_num1= 4;
numble1=m_num1;
UpdateData(FALSE);
}
else
{
m_num1=m_num1*10+4;
numble1=m_num1;
UpdateData(FALSE);
}
}
else
{
if (m_num1==0)
{
m_num1= 4;
numble2=m_num1;
UpdateData(FALSE);
}
else
{
m_num1=m_num1*10+4;
numble2=m_num1;
UpdateData(FALSE);
}
}
}
}
void CMyDlg::OnButton5()
{
if(minus_judge==1)
{
// TODO: Add your control notification handler code here
MessageBox("您好,负号输入后不可连续输入数字!");
}
else
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
if (number3==1)
{
if (m_num1==0)
{
m_num1= 5;
numble1=m_num1;
UpdateData(FALSE);
}
else
{
m_num1=m_num1*10+5;
numble1=m_num1;
UpdateData(FALSE);
}
}
else
{
if (m_num1==0)
{
m_num1= 5;
numble2=m_num1;
UpdateData(FALSE);
}
else
{
m_num1=m_num1*10+5;
numble2=m_num1;
UpdateData(FALSE);
}
}
}
}
void CMyDlg::OnButton6()
{
if(minus_judge==1)
{
// TODO: Add your control notification handler code here
MessageBox("您好,负号输入后不可连续输入数字!");
}
else
{
// TODO: Add your
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
.rar (30个子文件)
加法程序.dsp 4KB
加法程序.opt 54KB
StdAfx.cpp 210B
resource.h 1KB
加法程序.h 1KB
加法程序Dlg.h 2KB
加法程序.ncb 81KB
加法程序.clw 2KB
加法程序Dlg.cpp 12KB
StdAfx.h 1KB
加法程序.cpp 2KB
加法程序.dep 361B
加法程序.plg 2KB
Release
vc60.pdb 356KB
加法程序.map 33KB
加法程序.res 3KB
vc60.idb 49KB
加法程序Dlg.obj 42KB
加法程序.obj 11KB
加法程序.pdb 665KB
StdAfx.obj 102KB
加法程序.exe 32KB
加法程序.pch 5.67MB
加法程序.dsw 524B
res
加法程序.rc2 400B
加法程序.ico 1KB
Thumbs.db 3KB
加法程序.mak 7KB
加法程序.aps 36KB
加法程序.rc 6KB
共 30 条
- 1
资源评论
- 半城繁华1232014-06-16资源很赞!
- 假想寂寞Lucien2014-06-24资源很不错 很适合初学者看
- q262309972013-04-07此文件适合新手 高手勿看
fridco
- 粉丝: 0
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功