Solved

TreeView Refresh

Posted on 2001-09-06
4
422 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Put text in a picture ASP.NET C# 2 73
vb6 connector to mongodb 2 166
TT Auto Dashboard 13 104
VBA - If Bookmark = "XXBOOKMARKXX" then 15 67
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

710 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