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

📄 main.cpp

📁 功能描述: 1、快速添加、修改、删除客户信息。 2、直观方便的地域信息管理功能
💻 CPP
字号:
// Main.cpp : implementation file
//

#include "stdafx.h"
#include "源程序.h"
#include "Main.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include "Clime.h"
#include "Unit.h"
#include "ClientStyle.h"
#include "DMessage.h"
#include "Duty.h"
#include "DBiz.h"
#include "DUser.h"
/////////////////////////////////////////////////////////////////////////////
// CMain dialog


CMain::CMain(CWnd* pParent /*=NULL*/)
	: CDialog(CMain::IDD, pParent)
{
	//{{AFX_DATA_INIT(CMain)
	//}}AFX_DATA_INIT
}


void CMain::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CMain)
	DDX_Control(pDX, IDC_ButOP, m_ButOp);
	DDX_Control(pDX, IDC_ButUnit, m_ButUnit);
	DDX_Control(pDX, IDC_ButSort, m_ButSort);
	DDX_Control(pDX, IDC_ButMessage, m_ButMessage);
	DDX_Control(pDX, IDC_ButDuty, m_ButDuty);
	DDX_Control(pDX, IDC_ButCG, m_ButCG);
	DDX_Control(pDX, IDC_ButClime, m_ButClime);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CMain, CDialog)
	//{{AFX_MSG_MAP(CMain)
	ON_BN_CLICKED(IDC_ButClime, OnButClime)
	ON_BN_CLICKED(IDC_ButUnit, OnButUnit)
	ON_BN_CLICKED(IDC_ButSort, OnButSort)
	ON_BN_CLICKED(IDC_ButMessage, OnButMessage)
	ON_BN_CLICKED(IDC_ButDuty, OnButDuty)
	ON_BN_CLICKED(IDC_ButCG, OnButCG)
	ON_BN_CLICKED(IDC_BUTADD, OnButadd)
	ON_WM_CTLCOLOR()
	ON_BN_CLICKED(IDC_ButOP, OnButOP)
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMain message handlers

BOOL CMain::OnInitDialog() 
{
	CDialog::OnInitDialog();
	CRainFunction function;
//	this->m_StaOP.SetWindowText(function.Padl(User,20," ",2));
	this->m_ButClime.Bitmap(IDB_BUT_NOMAL,IDB_BUT_DOWN);
	this->m_ButOp.Bitmap(IDB_BUT_NOMAL,IDB_BUT_DOWN);
	this->m_ButCG.Bitmap(IDB_BUT_NOMAL,IDB_BUT_DOWN);
	this->m_ButDuty.Bitmap(IDB_BUT_NOMAL,IDB_BUT_DOWN);
	this->m_ButMessage.Bitmap(IDB_BUT_NOMAL,IDB_BUT_DOWN);
	this->m_ButSort.Bitmap(IDB_BUT_NOMAL,IDB_BUT_DOWN);
	this->m_ButUnit.Bitmap(IDB_BUT_NOMAL,IDB_BUT_DOWN);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CMain::OnButClime() 
{
	CClime dlg;
	dlg.DoModal();	
}

void CMain::OnButUnit() 
{
	CUnit dlg;
	dlg.DoModal();	
}

void CMain::OnButSort() 
{
	CClientStyle dlg;
	dlg.Value="客户类别管理";
	dlg.DateBase="客户类别表";
	dlg.DlgTipText="请在下面的文本框中添入新的客户类别。";
	dlg.DoModal();	
}

void CMain::OnButMessage() 
{
	CDMessage dlg;
	dlg.DoModal();	
}

void CMain::OnButDuty() 
{
	CDuty dlg;
	dlg.DoModal();
	
}

void CMain::OnButCG() 
{
	CDBiz dlg;
	dlg.DoModal();	
}

void CMain::OnButadd() 
{
	
}

HBRUSH CMain::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
	
/*	if(pWnd==&m_StaOP)
	{
	//	pDC->SetBkMode(TRANSPARENT);
		pDC->SetBkColor(RGB(255,255,255));	
	}
	*/
	// TODO: Return a different brush if the default is not desired
	return hbr;
}

void CMain::OnOK() 
{
	// TODO: Add extra validation here
	
	//CDialog::OnOK();
}

void CMain::OnButOP() 
{
	CDUser dlg;
	dlg.DoModal();
}

void CMain::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	CRect rect;
	this->GetWindowRect(&rect);
	CBitmap bit;
	bit.LoadBitmap(IDB_BLACK);
	CDC memDC;
	memDC.CreateCompatibleDC(&dc);
	memDC.SelectObject(&bit);
	dc.BitBlt(2,2,rect.Width(),rect.Height(),&memDC,0,0,SRCCOPY);
	bit.DeleteObject();
	memDC.DeleteDC();
}

⌨️ 快捷键说明

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