Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2006

Tip: Looking for answers? Try searching our database.

Double Buffer panel within SplitContainer to avoid TreeView flicke

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David - 16 Jul 2006 21:06 GMT
I have a treeview derived control placed within Panel2 of a SplitContainer
control on a form.  The TreeView flickers during updates so I set the
DoubleBuffered attribute to true (in the constructor of my class derived from
TreeView).  

It still flickers so I was thinking that it could be that DoubleBuffered
also needs to be set within the parent panel that contains this TreeView
derived control.  However, in this case, the parent is a panel that belongs
to a SplitContainer.   Of course, I can't directly set the DoubleBuffered
property of Panel2 and I was wondering if there is some other way to do this
or if I'm on the wrong track altogether.

Also, I'm using C++/CLI and the tree view nodes are user-drawn, does this
for any reason automatically rule out the use of double buffering on the
related tree view?

Thanks
David
Linda Liu [MSFT] - 17 Jul 2006 10:14 GMT
Hi David,

Thank you for posting.

This is a quick note to let you know that I am performing research on this
issue and I will get back to you as soon as possible. I appreciate your
patience.

Sincerely,
Linda Liu
Microsoft Online Community Support

============================================================================
=============================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

With newsgroups, MSDN subscribers enjoy unlimited, free support as opposed
to the limited number of phone-based technical support incidents. Complex
issues or server-down situations are not recommended for the newsgroups.
Issues of this nature are best handled working with a Microsoft Support
Engineer using one of your phone-based incidents.

============================================================================
=============================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Todd Wilder - 17 Jul 2006 17:55 GMT
I created my own SplitContainer type control and had similar issues (One of the panels would not stop flickering), even with C# setstyle (UserPaint, AllPaintinginWMPaint, OptimizedDoubleBuffer), etc. Then I discovered that if I used .SendToBack() (or maybe it was .BrintToFront()) on my flickering panel, it wouldnt flicker. Hope this helps.
Linda Liu [MSFT] - 19 Jul 2006 09:54 GMT
Hi David,

The DoubleBuffered is a property of Control, which gets or sets a value
indicating whether this control should redraw its surface using a secondary
buffer to reduce or prevent flicker.

Unfortunately, this property has no effect on the TreeView control.

In the sentence "The TreeView flickers during updates", do you mean the
TreeView flickers when you add tree nodes to it?  If so, you should use the
BeginUpdate and EndUpdate methods of the TreeView to reduce flicker. The
BeginUdpate method prevents the control from painting until the EndUpdate
method is called.

you could call the BeginUpdate method before you add tree nodes to the
TreeView and call the EndUpdate method after you finish adding these tree
nodes.

Hope this helps.
If you have any concerns, please feel free to let me know.


Sincerely,
Linda Liu
Microsoft Online Community Support
Jeff Gaines - 19 Jul 2006 10:27 GMT
>The DoubleBuffered is a property of Control, which gets or sets a value
>indicating whether this control should redraw its surface using a secondary
>buffer to reduce or prevent flicker.
>
>Unfortunately, this property has no effect on the TreeView control.

Aaaaaaaaaaagh!

That's a little nugget, could have saved me hours if I'd known :-)

Are there any other controls where DoubleBuffered doesn't work? If so can
we expect (hope?) it may in the future?

Signature

Jeff Gaines

Linda Liu [MSFT] - 25 Jul 2006 12:14 GMT
Hi Jeff,

Open MSDN Library for Visual Studio 2005, type "DoubleBuffered property" in
the input box in the Search panel on the right hand and press the Search
button. You will see all controls that don't support DoubleBuffered
property are listed in the result panel under the search input box.

These controls are listed below.
TreeView, MonthCalendar, ProgressBar, DateTimePicker, TrackBar and
StatusBar.

In addition, DoubleBuffered property isn't relevant to TextBoxBase class.
This property isn't meaningful to ToolBar and TabControl.

Maybe the above controls will support DoubleBuffered property in the future
release of VS.

Hope this helps.

Sincerely,
Linda Liu
Microsoft Online Community Support
David - 25 Jul 2006 13:46 GMT
Thanks Linda,

It turns out that most of our original problem stemmed from one place in our
code where we forgot to call Begin/End update (we update the tree view
control from multiple places).  There is still a little flicker in certain
cases, but we can live with it.  Thanks for the help.

Best regards,
David

> Hi Jeff,
>
[quoted text clipped - 18 lines]
> Linda Liu
> Microsoft Online Community Support
Linda Liu [MSFT] - 26 Jul 2006 06:19 GMT
Hi David,

Thank you for your update. I am glad to hear that the problem has been
almost fixed.

If you have any other questions in the future, please don't hesitate to
contact us. It's always our pleasure to be of assistance.

Have a wonderful day!

Sincerely,
Linda Liu
Microsoft Online Community Support

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.