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

📄 editdlg.cpp

📁 mfc的插件 课程设计的东西希望大家喜欢
💻 CPP
字号:
// EditDlg.cpp : implementation file
//

#include "stdafx.h"
#include "baoyi.h"
#include "EditDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CEditDlg dialog


CEditDlg::CEditDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CEditDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CEditDlg)
	m_strAve = _T("");
	m_nScore1 = 0;
	m_nScore2 = 0;
	m_nScore3 = 0;
	//}}AFX_DATA_INIT
}


void CEditDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CEditDlg)
	DDX_Text(pDX, IDC_AVERAGE, m_strAve);
	DDV_MaxChars(pDX, m_strAve, 20);
	DDX_Text(pDX, IDC_EDIT1, m_nScore1);
	DDV_MinMaxInt(pDX, m_nScore1, 0, 100);
	DDX_Text(pDX, IDC_EDIT2, m_nScore2);
	DDV_MinMaxInt(pDX, m_nScore2, 0, 100);
	DDX_Text(pDX, IDC_EDIT3, m_nScore3);
	DDV_MinMaxInt(pDX, m_nScore3, 0, 100);
	//}}AFX_DATA_MAP
}


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

/////////////////////////////////////////////////////////////////////////////
// CEditDlg message handlers

void CEditDlg::OnButton1() 
{
	UpdateData();
	double ave=(double)(m_nScore1+m_nScore2+m_nScore3)/3.0;
	m_strAve.Format("%6.2f",ave);
	UpdateData(FALSE);		
}

BOOL CEditDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
m_strAve="0.00";
UpdateData(FALSE);	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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