Solved

TreeView Refresh

Posted on 2001-09-06
4
410 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

813 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