如何CListCtrl内容拖放到CTreeCtrl中去
展开全部
说起来比较麻烦,去找个例程看看吧
OnBegindragList(...)
{
...
...
m_pimageListDrag = m_ctlList.CreateDragImage(...);
m_pimageListDrag->DragShowNolock(TRUE); // lock updates and show drag image
m_pimageListDrag->BeginDrag(0, CPoint(0, 0));
m_pimageListDrag->DragEnter(this, ...);
m_pimageListDrag->DragMove(...); // move image to overlap original icon
SetCapture();
}
OnMouseMove(...)
{
m_pimageListDrag->DragLeave(this); // unlock the window and hide drag image
m_ctlTree.SelectDropTarget(...);
m_pimageListDrag->DragEnter(this, ...); // lock updates and show drag image
}
OnLButtonUp(...)
{
m_ctlTree.InsertItem(...);
m_pimageListDrag->DragLeave(this);
m_pimageListDrag->EndDrag();
m_ctlTreeLayerGroup.SelectDropTarget(NULL);
delete m_pimageListDrag;
}
OnBegindragList(...)
{
...
...
m_pimageListDrag = m_ctlList.CreateDragImage(...);
m_pimageListDrag->DragShowNolock(TRUE); // lock updates and show drag image
m_pimageListDrag->BeginDrag(0, CPoint(0, 0));
m_pimageListDrag->DragEnter(this, ...);
m_pimageListDrag->DragMove(...); // move image to overlap original icon
SetCapture();
}
OnMouseMove(...)
{
m_pimageListDrag->DragLeave(this); // unlock the window and hide drag image
m_ctlTree.SelectDropTarget(...);
m_pimageListDrag->DragEnter(this, ...); // lock updates and show drag image
}
OnLButtonUp(...)
{
m_ctlTree.InsertItem(...);
m_pimageListDrag->DragLeave(this);
m_pimageListDrag->EndDrag();
m_ctlTreeLayerGroup.SelectDropTarget(NULL);
delete m_pimageListDrag;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询