?? departnamelist.cpp
字號:
// DepartNameList.cpp : implementation file
//
#include "stdafx.h"
#include "mydb.h"
#include "DepartNameList.h"
#include "DepartSet.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDepartNameList dialog
CDepartNameList::CDepartNameList(CWnd* pParent /*=NULL*/)
: CDialog(CDepartNameList::IDD, pParent)
{
//{{AFX_DATA_INIT(CDepartNameList)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CDepartNameList::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDepartNameList)
DDX_Control(pDX, IDC_DEPARTNAME_LIST, m_DepartNameList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDepartNameList, CDialog)
//{{AFX_MSG_MAP(CDepartNameList)
ON_BN_CLICKED(IDC_ALL, OnAll)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDepartNameList message handlers
BOOL CDepartNameList::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CDepartSet m_DepartSet;
if(m_DepartSet.IsOpen())
ASSERT(FALSE);
try
{
m_DepartSet.Open();
}
catch(CDBException*e)
{
AfxMessageBox(e->m_strError);
}
while(!m_DepartSet.IsEOF())
{
m_DepartNameList.AddString(m_DepartSet.m_DepartName);
m_DepartSet.MoveNext();
}
m_DepartSet.Close();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDepartNameList::OnAll()
{
// TODO: Add your control notification handler code here
m_SelectedDepartName="ALL";
CDialog::OnOK();
}
void CDepartNameList::OnOK()
{
// TODO: Add extra validation here
int index=m_DepartNameList.GetCurSel();
m_DepartNameList.GetText(index,m_SelectedDepartName);
CDialog::OnOK();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -