📄 computer.cpp
字号:
// Computer.cpp : implementation file
//
#include "stdafx.h"
#include "gdzc.h"
#include "Computer.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CComputer dialog
CComputer::CComputer(CWnd* pParent /*=NULL*/)
: CDialog(CComputer::IDD, pParent)
{
//{{AFX_DATA_INIT(CComputer)
// NOTE: the ClassWizard will add member initialization here
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
//}}AFX_DATA_INIT
}
void CComputer::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CComputer)
// NOTE: the ClassWizard will add DDX and DDV calls here
DDX_Control(pDX, IDC_LIST2, m_List2);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CComputer, CDialog)
//{{AFX_MSG_MAP(CComputer)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CComputer message handlers
BOOL CComputer::OnInitDialog()
{
CString sSQL;
// this->ShowWindow(SW_SHOW);
sSQL.Format("select * from 创维电脑及通讯设备表 ");
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE);
CString RowName[11]={"固定资产编码","设备名称","品牌型号","处理器","内存","显卡","光驱","网卡","推荐部门","入帐日期","备注"};
for(int m=0;m<11;m++)
{
// m_List2.InsertColumn(m,"ok",LVCFMT_LEFT,80);
m_List2.InsertColumn(m,"ok",LVCFMT_LEFT,80);
}
DWORD dwStyle;
dwStyle = m_List2.GetStyle();
dwStyle |= LVS_EX_GRIDLINES |LVS_EX_FULLROWSELECT|LVS_SHOWSELALWAYS ;
m_List2.SetExtendedStyle(dwStyle);
m_List2.SetTextBkColor(RGB(254,125,125));
m_List2.SetBkColor(RGB(125,125,255));
rst.Open(sSQL,adCmdText);
CString sFieldName;
int i;
rst.MoveFirst();
m_List2.DeleteAllItems();
for(i=0;i<rst.GetRecordCount();i++)
{
m_List2.InsertItem(i,"");
}
for(i=0;i<rst.GetRecordCount();i++)
{
rst.Move(i);
for(m=0;m<rst.GetFieldCount();m++)
{
sFieldName=rst.GetFieldName(m);
m_List2.SetItemText(i,m,rst.GetFieldValue(sFieldName));
}
}
return TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -