⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aaa.cpp

📁 在单个文档下人们可以进行加法计算的加法计算器
💻 CPP
字号:
// AAA.cpp : implementation file
//

#include "stdafx.h"
#include "EE.h"
#include "AAA.h"

#include "stdio.h"
 #include "math.h"



#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// AAA dialog


AAA::AAA(CWnd* pParent /*=NULL*/)
	: CDialog(AAA::IDD, pParent)
{
	//{{AFX_DATA_INIT(AAA)
	medit1 = 0.0f;
	medit2 = 0.0f;
	//}}AFX_DATA_INIT
}


void AAA::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(AAA)
	DDX_Text(pDX, IDC_EDIT1, medit1);
	DDX_Text(pDX, IDC_EDIT2, medit2);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(AAA, CDialog)
	//{{AFX_MSG_MAP(AAA)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// AAA message handlers

void AAA::OnButton1() 
{
	// TODO: Add your control notification handler code here

    
     CDC *pDC=GetDC();    // 获得客户区的设备环境
    UpdateData(true);     //获取对话框数据
     float x;
         pDC->TextOut(15, 30, "       ");
        x=medit1+medit2; 
	  // medit1是控件IDC_EDIT1变量
      // medit2是控件IDC_EDIT2变量
        
      CString str;
      str.Format("%f", x);
    pDC->TextOut(40, 30, str);
    pDC->TextOut(20, 30, " x=");
     UpdateData(false);    //初始化对话框
 	


	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -