Link to home
Start Free TrialLog in
Avatar of Egore
Egore

asked on

TreeView Refresh

I'm using VB6.0 and I'm sure that I'm just not seeing some property of the TreeView control.  Is it possible to make it so that the TreeView control will not refresh itself while working with it?  Kind of like the "Redraw" property of the FlexGrid control.  I have a routine that does a lot of moving around of nodes in a TreeView control and it is causing a lot of flicker.  I want to keep it from refreshing itself while I do these moves.

Thanks,
Alex
Avatar of PatOBrien
PatOBrien

have you tried setting its "visible" property to false during the node movements....

or maybe the "enabled" property would be good enough.

Pat
Add in this API:
Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long



Add this to the working area of your code:

    LockWindowUpdate (TV1.hWnd)  'TV1 is the name of your TreeView Control
      'Your Work Code
    LockWindowUpdate (0&)  'Unlocks the control and refresh
ASKER CERTIFIED SOLUTION
Avatar of johnczimm
johnczimm

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Egore

ASKER

Sweet!  I had never heard of this API call, that rocks!!  This would have made my life so much better in the past!  Thanks!

- Alex