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

📄 count.cpp

📁 本人工作中的一个软件开发实例。里面包含了数据库
💻 CPP
字号:
// Count.cpp : implementation file
//

#include "stdafx.h"
#include "oil.h"
#include "Count.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCount dialog


CCount::CCount(CWnd* pParent /*=NULL*/)
	: CDialog(CCount::IDD, pParent)
{
	//{{AFX_DATA_INIT(CCount)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CCount::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCount)
	DDX_Control(pDX, IDC_LIST_BILL, m_listBill);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CCount, CDialog)
	//{{AFX_MSG_MAP(CCount)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCount message handlers

BOOL CCount::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	// TODO: Add extra initialization here	

	//设置List Control背景色及字体颜色
	m_listBill.SetBkColor(RGB(240,247,233));;
	m_listBill.SetTextColor(RGB(250,0,0));

	//清空List控件的数据
    for(int delcolumn=100;delcolumn>=0;delcolumn--)
	    m_listBill.DeleteColumn(delcolumn);

	//设置List控件的列
    DWORD		dwStyle;
	RECT		rect;
	LV_COLUMN	lvc;
	dwStyle = m_listBill.GetStyle();
	dwStyle |= LVS_EX_GRIDLINES |LVS_EX_FULLROWSELECT|LVS_SHOWSELALWAYS ;

	m_listBill.SetExtendedStyle(dwStyle);
	m_listBill.GetClientRect(&rect);
	lvc.mask = LVCF_TEXT | LVCF_SUBITEM | LVCF_WIDTH |LVCF_FMT;
	lvc.fmt=LVCFMT_LEFT;

	lvc.iSubItem = 0;
	lvc.pszText = _T("提油单号");
	lvc.cx = 80;
	m_listBill.InsertColumn(1,&lvc);

	lvc.iSubItem = 1;
	lvc.pszText = _T("委托书号");
	lvc.cx = 80;
	m_listBill.InsertColumn(2,&lvc);

    lvc.iSubItem = 2;
	lvc.pszText = _T("客户名");
	lvc.cx = 120;
	m_listBill.InsertColumn(3,&lvc);

	lvc.iSubItem = 3;
	lvc.pszText = _T("开单日期");
	lvc.cx = 85;
	m_listBill.InsertColumn(4,&lvc);

	lvc.iSubItem = 4;
	lvc.pszText = _T("有效期限");
	lvc.cx = 85;
	m_listBill.InsertColumn(5,&lvc);

	lvc.iSubItem = 5;
	lvc.pszText = _T("油量");
	lvc.cx = 60;
	m_listBill.InsertColumn(6,&lvc);

	lvc.iSubItem = 6;
	lvc.pszText = _T("剩余量");
	lvc.cx = 80;
	m_listBill.InsertColumn(7,&lvc);

	lvc.iSubItem = 7;
	lvc.pszText = _T("油品名");
	lvc.cx = 60;
	m_listBill.InsertColumn(8,&lvc);

	lvc.iSubItem = 8;
	lvc.pszText = _T("状态");
	lvc.cx = 60;
	m_listBill.InsertColumn(9,&lvc);	
   
	//显示数据
    //OnRadio();
    
	//选择第一行
	DispListCtrlRow(&m_listBill,0);

	return 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 + -