Solved

TreeView Refresh

Posted on 2001-09-06
4
417 Views
Last Modified: 2011-09-20
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
0
Comment
Question by:Egore
  • 2
4 Comments
 
LVL 5

Expert Comment

by:PatOBrien
ID: 6461554
have you tried setting its "visible" property to false during the node movements....

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

Pat
0
 
LVL 1

Expert Comment

by:johnczimm
ID: 6461587
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
0
 
LVL 1

Accepted Solution

by:
johnczimm earned 50 total points
ID: 6461591
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
0
 
LVL 3

Author Comment

by:Egore
ID: 6461630
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
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

761 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question