Windows Develop Bookmark and Share   
 index > Windows Forms General > Treeview flicker with TVS_EX_FADEINOUTEXPANDOS
 

Treeview flicker with TVS_EX_FADEINOUTEXPANDOS

Hello, I want to make the treeview Themed.
So I am using following code.

Dim dw As Integer = NativeMethods.SendMessage(Me.tv1.Handle, NativeMethods.TVM_GETEXTENDEDSTYLE, 0, 0)

' Update style
dw = dw Or NativeMethods.TVS_EX_AUTOHSCROLL

' autoscroll horizontaly

dw = dw Or NativeMethods.TVS_EX_FADEINOUTEXPANDOS

' auto hide the +/- signs
' set style
NativeMethods.SendMessage(Me.tv1.Handle, NativeMethods.TVM_SETEXTENDEDSTYLE, 0, dw)

' little black/empty arrows and blue highlight on treenodes
NativeMethods.SetWindowTheme(Me.tv1.Handle, "explorer", Nothing)

This code is working fine but only the problem is that when I am including following code then on mouse hover treeview is BADLY flickering.
dw = dw Or NativeMethods.TVS_EX_FADEINOUTEXPANDOS.
When I am excluding the above part of code, treeview flicker goes out but AutoFadeIn-Out doesn't work.

Anyone having idea about this?

Thanks in advence.

Amolpbhavsar  Monday, December 22, 2008 10:33 AM
Also turn on the TVS_EX_DOUBLEBUFFER style.
Hans Passant.
nobugz  Monday, December 22, 2008 11:15 AM
Also turn on the TVS_EX_DOUBLEBUFFER style.
Hans Passant.
nobugz  Monday, December 22, 2008 11:15 AM

You can use google to search for other answers

Custom Search

More Threads

• Panels, the Designer, in C#
• I set DrawMode as OwnerDrawFixed, but can't get the horizontal scroll bar any more. (ListBox)
• Handling KeyDown at the right level
• Screen Capturing with C#
• displaying custom control in datagridview column
• Treeview Tutorial
• difference between .net 1.0 splitter and .net 2.0 splittercontainer
• AllowMerge in ToolStrip don't work in .NET Framework v2.0.50727
• Merging Menu strips
• Setting a button on one tab from another tab