TreeView DragDrop images the righ way..

TreeView DragDrop images the righ way..

Post by Per Rollvan » Sat, 30 Nov 2002 04:43:11


Hi All!

I downloaded Brad Martinez' exellent example on how to create drag-images
from his site, but it is based on the old version of common-controls
(version 5), and don't seem to work right with version 6.

It uses a lot (!) of API, and I haven't enough knowlenge of CC to know what
constants that may have changed...

Is there anybody out there that have encountered similar problems, and
managed to get it to work right with v. 6?
I use VB 6, SP5.

TIA

Per Rollvang

 
 
 

TreeView DragDrop images the righ way..

Post by Brad Martine » Sat, 30 Nov 2002 23:07:01


Per,

I strongly recommend not using the Mscomctl.ocx TreeView,
instead use the Comctl32.ocx TreeView and just API your way
to the functionality you need. Mscomctl.ocx is just too chalk
full of bugs. And Comctl32.ocx is more prevalent as well, I'm
pretty sure it came with all OSs since Win98, maybe even
Win95 OSR2. I continually receive mail stating that some
of the TreeView and ListView demos I did don't work with
Mscomctl.ocx, which isn't too surprising. My answer is to
say that it's simply not worth dealing with that library...

But if you really want to get the TreeView drag/drop demo to
work with the Mscomctl.ocx TreeView, try changing the code
in its TreeView1_MouseMove to look like this:

  If (Button = m_iButton) Then
    If (m_himlDrag = 0) And ((m_nodDrag Is Nothing) = False) Then
      Call BeginDrag
    ElseIf m_himlDrag Then
      Call DoDrag
    End If
' <new> --------------------------------------------------------
' Mscomctl.ocx doesn't get a MouseUp after drag completion
  ElseIf m_himlDrag Then
    Call TreeView1_MouseUp(Button, Shift, x, y)
' </new> --------------------------------------------------------
  End If

--
Brad Martinez, http://www.mvps.org
Please direct questions/replies to the newsgroup


> Hi All!

> I downloaded Brad Martinez' exellent example on how to create drag-images
> from his site, but it is based on the old version of common-controls
> (version 5), and don't seem to work right with version 6.

> It uses a lot (!) of API, and I haven't enough knowlenge of CC to know what
> constants that may have changed...

> Is there anybody out there that have encountered similar problems, and
> managed to get it to work right with v. 6?
> I use VB 6, SP5.

> TIA

> Per Rollvang