龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > VC开发 >

让ListBox控件支持拖动(2)

时间:2009-12-30 15:42来源:未知 作者:admin 点击:
分享到:
protected: file://{{AFX_MSG(CMyListBox) afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnLButtonUp(UINT nFlags, CPoint point); afx_msg void OnMouseMove(UINT nFlags, CPoint point);
 protected:
  file://{{AFX_MSG(CMyListBox)
  afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  // NOTE - the ClassWizard will add and remove member functions here.
file://}}AFX_MSG

 DECLARE_MESSAGE_MAP()
};

file://{{AFX_INSERT_LOCATION}}

 #endif //  !defined(AFX_MYLISTBOX_H__CF3EDAA5_BBD7_43CD_80CB_A86B65D9A607__INCLUDED_)


 // MyListBox.cpp : implementation file
 file://

 #include "stdafx.h"
 #include "sditest.h"
 #include "MyListBox.h"
 
 #ifdef _DEBUG
 #define new DEBUG_NEW
 #undef THIS_FILE
 static char THIS_FILE[] = __FILE__;
 #endif

 // CMyListBox

 CMyListBox::CMyListBox()
  {
   m_LButtonDownFlag = FALSE;
   m_MouseMoveFlag = FALSE;
  }

 CMyListBox::~CMyListBox()
  {
 }

 BEGIN_MESSAGE_MAP(CMyListBox, CListBox)
 file://{{AFX_MSG_MAP(CMyListBox)
 ON_WM_LBUTTONDOWN()
 ON_WM_LBUTTONUP()
 ON_WM_MOUSEMOVE()
 // NOTE - the ClassWizard will add and remove mapping macros here.
 file://}}AFX_MSG_MAP
END_MESSAGE_MAP()

精彩图集

赞助商链接