Solved

TreeView Refresh

Posted on 2001-09-06
4
399 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now