PC Review


Reply
Thread Tools Rate Thread

How to disable TreeView screen update?

 
 
baobob@my-deja.com
Guest
Posts: n/a
 
      4th May 2008
Relative newbie Q:

I have a process that goes thru an Excel 2002 TreeView and moves 'n
prunes a lot of Nodes.

Even though I (don't think I'm) actually selecting the Nodes I'm
working on (I never use .SelectedItem), still the whole tree insists
on visually updating in real time to reflect every change, resulting
in ungodly (and time-consuming) visual churn.

I cannot find a ScreenUpdate property in TreeView (or in any VBA
control, for that matter). And setting:

- TreeView.Enabled
- Application.ScreenUpdating

to False fail to stop it.

What property do I use?

Thanks much.

***
 
Reply With Quote
 
 
 
 
RB Smissaert
Guest
Posts: n/a
 
      5th May 2008
Try preventing the repaint with the Windows API:

'this goes at the top of the module or at the top of the form code
'---------------------------------------------------------------------------
Private Const WM_SETREDRAW = &HB
Private Declare Function SendMessage Lib "user32" Alias _
"SendMessageA" (ByVal hwnd As Long, ByVal wMsg As _
Long, ByVal wParam As Long, lParam As Any) As Long

'this goes in your procedure
'--------------------------------
With TreeView1
SendMessage .hwnd, WM_SETREDRAW, 0, 0
'run your treeview code here
SendMessage .hwnd, WM_SETREDRAW, 1, 0
End With


RBS

<(E-Mail Removed)> wrote in message
news:12e39a29-309b-4c54-9535-(E-Mail Removed)...
> Relative newbie Q:
>
> I have a process that goes thru an Excel 2002 TreeView and moves 'n
> prunes a lot of Nodes.
>
> Even though I (don't think I'm) actually selecting the Nodes I'm
> working on (I never use .SelectedItem), still the whole tree insists
> on visually updating in real time to reflect every change, resulting
> in ungodly (and time-consuming) visual churn.
>
> I cannot find a ScreenUpdate property in TreeView (or in any VBA
> control, for that matter). And setting:
>
> - TreeView.Enabled
> - Application.ScreenUpdating
>
> to False fail to stop it.
>
> What property do I use?
>
> Thanks much.
>
> ***


 
Reply With Quote
 
baobob@my-deja.com
Guest
Posts: n/a
 
      6th May 2008
RB:

Thanks very much for your reply. That will certainly work.

***
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to disable editing of a Treeview node. cr113 Microsoft Access Forms 2 29th Dec 2009 03:35 PM
How to disable treeview postback in asp.net 2.0? rockdale Microsoft ASP .NET 2 14th Dec 2006 07:16 PM
TreeView - disable or hide node meska Microsoft C# .NET 4 25th Aug 2004 04:09 PM
Disable TreeView control... marius Microsoft ASP .NET 0 27th Nov 2003 01:05 PM
How to Hide but not Disable Scrollbars in TreeView ? Gawelek Microsoft C# .NET 0 19th Nov 2003 03:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:15 PM.