📄 dujt.cpp
字号:
// DUjt.cpp : implementation file
//
#include "stdafx.h"
#include "gdzc.h"
#include "DUjt.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDUjt dialog
CDUjt::CDUjt(CWnd* pParent /*=NULL*/)
: CDialog(CDUjt::IDD, pParent)
{
//{{AFX_DATA_INIT(CDUjt)
//}}AFX_DATA_INIT
}
void CDUjt::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDUjt)
DDX_Control(pDX, IDC_LIST1, m_List2);
DDX_Control(pDX, IDC_COMBO2, m_ComFH);
DDX_Control(pDX, IDC_EDIT1, m_EdtJT);
DDX_Control(pDX, IDC_COMBO1, m_ComZD);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDUjt, CDialog)
//{{AFX_MSG_MAP(CDUjt)
ON_CBN_KILLFOCUS(IDC_COMBO1, OnKillfocusCombo1)
ON_BN_CLICKED(IDC_BUTFIND, OnButfind)
ON_BN_CLICKED(IDC_BUTJT, OnButjt)
ON_BN_CLICKED(IDC_BUTEXIT, OnButexit)
ON_NOTIFY(NM_DBLCLK, IDC_LIST1, OnDblclkList1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDUjt message handlers
void CDUjt::OnOK()
{
// TODO: Add extra validation here
//CDialog::OnOK();
}
BOOL CDUjt::OnInitDialog()
{
CDialog::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,RowName[m],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; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDUjt::OnKillfocusCombo1()
{
m_LX=rst.GetFieldType(m_ComZD.GetCurSel());
}
void CDUjt::OnButfind()
{
}
void CDUjt::OnButjt()
{
}
void CDUjt::OnButexit()
{
this->OnCancel();
}
void CDUjt::OnDblclkList1(NMHDR* pNMHDR, LRESULT* pResult)
{
if(this->m_Grid.GetHotItem()<0)
return;
else
OnButjt();
*pResult = 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -