tree view themed scroll bars

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

(Framework V1.1)

Does the TreeView control not work with Visual styles (as far as the scroll
bars) ?
I have Application.EnableVisualStyles() in my Main method before form
creation, but the tree still displays the boxy gray scrollbars.

Is there a workaround for this?

Dan
 
Add the following code to Form_Load(assuming your treeview is called
TreeView1):

\\\
Dim TreeWidth As Int32 = TreeView1.Width
TreeView1.Width = 0
TreeView1.Width = TreeWidth
///

You should not actually see the Treeview changing size, but the scrollbar
will have dissapeared from the treeview and will re-appear with VisualStyles
applied when it is needed.

There are more complicated workarounds, but this one works better than any
of the others I have tried.

One exception to that is to move the Treeview1.Nodes.AddRange(...) from
InitializeComponent() to Form_Load()
 
Back
Top