本文简单介绍下VC列表控件的点击事件。
1.新建对话框应用程序
新建对话框应用程序,并且添加List列表控件。
2.设置相关变量和函数
class CListClickDlg : public CDialog
{
// Construction
public:
CListClickDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{
{AFX_DATA(CListClickDlg)
enum { IDD = IDD_LISTCLICK_DIALOG };
CListCtrl m_list;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{
{AFX_VIRTUAL(CListClickDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{
{AFX_MSG(CListClickDlg)
virtual BOOL OnIn