showselldlg.cpp

来自「是关于SQL的一些程序 很好很经典的~大家又兴趣的可以学习下」· C++ 代码 · 共 81 行

CPP
81
字号
// ShowSellDlg.cpp : implementation file
//

#include "stdafx.h"
#include "售货系统.h"
#include "ShowSellDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CDatabase m_database;
extern CString username;
/////////////////////////////////////////////////////////////////////////////
// CShowSellDlg dialog


CShowSellDlg::CShowSellDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CShowSellDlg::IDD, pParent)
{
	m_account=0;
	m_client=0;
	isok=true;
	//{{AFX_DATA_INIT(CShowSellDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CShowSellDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CShowSellDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CShowSellDlg, CDialog)
	//{{AFX_MSG_MAP(CShowSellDlg)
	ON_WM_PAINT()
	ON_BN_CLICKED(IDSELLOK, OnSellok)
	ON_BN_CLICKED(IDSELLCANCEL, OnSellcancel)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CShowSellDlg message handlers

void CShowSellDlg::OnPaint() 
{
	CPaintDC dc(this); // device context for paintin
	CFont m_font;
	//设置字体样式
	m_font.CreateFont(50,0,0,0,FW_BLACK,FALSE,FALSE,FALSE,
		GB2312_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS, 
		DEFAULT_QUALITY,FIXED_PITCH | FF_MODERN,"楷体_GB2312");
	CFont* pOldFont=(CFont*)dc.SelectObject(&m_font);
	dc.SetBkMode(TRANSPARENT);
	CString str;
	str.Format("应付金额 : %.2f",m_account);
	dc.TextOut(20,20,str);
	str.Format("实付金额 : %.2f",m_client);
	dc.TextOut(20,120,str);
	str.Format("应找余额 : %.2f",m_client-m_account);
	dc.TextOut(20,220,str);
}

void CShowSellDlg::OnSellok() 
{

	CDialog::OnOK();
}

void CShowSellDlg::OnSellcancel() 
{
	isok=false;
	CDialog::OnCancel();
}

⌨️ 快捷键说明

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