?? seltypedlg.cpp
字號:
// SelTypeDlg.cpp : implementation file
//
#include "stdafx.h"
#include "HrSys.h"
#include "SelTypeDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSelTypeDlg dialog
CSelTypeDlg::CSelTypeDlg(CWnd* pParent /*=NULL*/)
: CDialog(CSelTypeDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CSelTypeDlg)
//}}AFX_DATA_INIT
}
void CSelTypeDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSelTypeDlg)
DDX_Control(pDX, IDC_LIST1, m_List);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSelTypeDlg, CDialog)
//{{AFX_MSG_MAP(CSelTypeDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSelTypeDlg message handlers
void CSelTypeDlg::OnOK()
{
// TODO: Add extra validation herecUserType =
UpdateData(TRUE); //將用戶輸入的數據讀取到成員變量中
int cnt;
cnt = m_List.GetCount(); //讀取記錄個數
CString cType;
for(int a=0;a<cnt;a++)
{
if(m_List.GetSel(a)) // 如果選擇了當前項,則添加到cUserType中
{
m_List.GetText(a,cType); //獲取選擇內容
if(cUserType == "")
cUserType = cType;
else
cUserType = cUserType + "," + cType;
}
}
CDialog::OnOK();
}
BOOL CSelTypeDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
//裝入所有的用戶類型
m_List.AddString("普通用戶");
m_List.AddString("系統管理員");
m_List.AddString("人事專員");
m_List.AddString("培訓管理員");
m_List.AddString("車輛管理員");
m_List.AddString("會議室管理員");
m_List.AddString("資料管理員");
m_List.AddString("客戶管理員");
m_List.AddString("客戶代表");
m_List.AddString("庫存管理員");
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 + -