Discussion:
Is there a way to double buffer TreeView if I am drawing the nodes?
(too old to reply)
David Thielen
2009-07-18 23:12:19 UTC
Permalink
I erase the background and then render the requested node(s) in my
DrawNode handler. This causes it to flicker. Is there a way to tell it
to double buffer?

Control.DoubleBuffer is ignored for TreeView. This is an issue even
when not updating it, when I expand/contract or resize the window.

thanks - dave

***@at-at-***@windward.dot.dot.net
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
Zhi-Xin Ye [MSFT]
2009-07-20 13:23:56 UTC
Permalink
Hi Dave,

You can try preventing the TreeView from erasing its background like
follows, this approach would avoid the flicker.

public class MyTreeView : TreeView
{
private const int WM_ERASEBKGND = 0x0014;

protected override void WndProc(ref Message msg)
{
if (msg.Msg == WM_ERASEBKGND)
{
return;
}
base.WndProc(ref msg);
}
}

Please try my suggestion and let me know wether it make sense to you.

Have a nice day!

Sincerely,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
***@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
David Thielen
2009-07-21 21:58:07 UTC
Permalink
Post by Zhi-Xin Ye [MSFT]
Hi Dave,
You can try preventing the TreeView from erasing its background like
follows, this approach would avoid the flicker.
public class MyTreeView : TreeView
{
private const int WM_ERASEBKGND = 0x0014;
protected override void WndProc(ref Message msg)
{
if (msg.Msg == WM_ERASEBKGND)
{
return;
}
base.WndProc(ref msg);
}
}
Please try my suggestion and let me know wether it make sense to you.
That did it - thanks - dave


***@at-at-***@windward.dot.dot.net
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
David Thielen
2009-09-09 20:28:46 UTC
Permalink
This post might be inappropriate. Click to display it.
Zhi-Xin Ye [MSFT]
2009-09-16 08:05:50 UTC
Permalink
Hi Dave,

The Graphics class does not have a DoubleBuffer property. You can just draw
what you want in the DrawNode event handler using the Graphics object.

If you have any questions or concerns, please feel free to let me know.

Best Regards,
Zhi-Xin Ye
Microsoft Online Support Team
Zhi-Xin Ye [MSFT]
2009-09-21 01:25:57 UTC
Permalink
Hi Dave,

How is the problem now? Do you still need help on it? If you have any
questions or concerns, please feel free to let me know.

Best Regards,
Zhi-Xin Ye
Microsoft Online Support Team

Chris Madsen
2009-07-22 00:08:44 UTC
Permalink
TreeView has BeginUpdate and EndUpdate that handles this for me just fine in
VB.NET 2005.

Chris
Post by David Thielen
I erase the background and then render the requested node(s) in my
DrawNode handler. This causes it to flicker. Is there a way to tell it
to double buffer?
Control.DoubleBuffer is ignored for TreeView. This is an issue even
when not updating it, when I expand/contract or resize the window.
thanks - dave
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com
Cubicle Wars - http://www.windwardreports.com/film.htm
Loading...