CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    12

    URGENT : How to drag and drop items between two CListCtrl ??

    Hi,

    My project is a dialog box based application. I have several list controls (CListCtrl). I need to allow drag and drop of items between these controls.
    How can I do ?? It is very important for my project, please help.

    Waiting for your reply,

    Best regards,

    Stéphane.



  2. #2

    Re: URGENT : How to drag and drop items between two CListCtrl ??

    look at mfc demo-source comon-controls (cmnctrl-s), there is example for drag and drop inside treectrls and listctrl
    you need to use the same but in begin-drag and mouse-move you will not give this-ptr (wnd of actual control) but NULL and coordinates you need recalcutale from client to screen
    this way you will able to drag-drop over full screen
    during mouse-up you will do test coordinates with another-ctrl-ptr->hit-test() (or something like this)
    maybe this helps you


  3. #3
    Join Date
    Apr 1999
    Posts
    12

    Re: URGENT : How to drag and drop items between two CListCtrl ??

    Well, I tried what you told me. However, if now I'm able to drag all over the screen, when I drop the item, it comes back in its parent list ctrl. When I try to use HitTest it gives me Access Violation error !! My three list ctrl have each a variable of CMyListCtrl associated, but I can't use them in the CMyListCtrl::OnMouseUp function !!!!

    Please help Stephane.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured