접기
IDD_CHECKLISTBOXCBN_DIALOG DIALOGEX 0, 0, 167, 71
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "CheckListBoxCBN"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,110,5,50,14
PUSHBUTTON "Cancel",IDCANCEL,110,21,50,14
LISTBOX IDC_LIST1,5,5,95,55,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
END
class CCheckListBoxCBNDlg : public CDialog
{
// Construction
...
// Dialog Data
//{{AFX_DATA(CCheckListBoxCBNDlg)
enum { IDD = IDD_CHECKLISTBOXCBN_DIALOG };
//}}AFX_DATA
// {
CCheckListBox m_ctlCheckList;
// }
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCheckListBoxCBNDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
...
// Generated message map functions
//{{AFX_MSG(CCheckListBoxCBNDlg)
...
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnSelchangeList1();
//}}AFX_MSG
// {
afx_msg void OnCheckchangeList1();
// }
DECLARE_MESSAGE_MAP()
};
void CCheckListBoxCBNDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCheckListBoxCBNDlg)
//}}AFX_DATA_MAP
// {
DDX_Control(pDX, IDC_LIST1, m_ctlCheckList);
// }
}
BEGIN_MESSAGE_MAP(CCheckListBoxCBNDlg, CDialog)
//{{AFX_MSG_MAP(CCheckListBoxCBNDlg)
...
ON_WM_QUERYDRAGICON()
ON_LBN_SELCHANGE(IDC_LIST1, OnSelchangeList1)
//}}AFX_MSG_MAP
// {
ON_CLBN_CHKCHANGE (IDC_LIST1, OnCheckchangeList1)
// }
END_MESSAGE_MAP()
...
BOOL CCheckListBoxCBNDlg::OnInitDialog()
{
...
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
// {
m_ctlCheckList.ResetContent();
m_ctlCheckList.SetCheckStyle ( BS_AUTOCHECKBOX );
m_ctlCheckList.AddString("Fumble");
m_ctlCheckList.SetCheck ( 0, 0 );
...
// }
return TRUE; // return TRUE unless you set the focus to a control
}
...
void CCheckListBoxCBNDlg::OnSelchangeList1()
{
// TODO: Add your control notification handler code here
...
}
void CCheckListBoxCBNDlg::OnCheckchangeList1()
{
// TODO: Add your control notification handler code here
...
}
접기