Thursday, January 18, 2007

Turn Your .Net Treeview into a Vista Treeview

The Moth - TreeViewVista

"In an older post I highlighted one of the changes in the TreeView control in Vista’s explorer:

"...the treeview has no horizontal scrollbar at the bottom and scrolling happens for you automatically as you select nodes that are not fully visible and as you mouse over around..."

I then offered some code that makes the System.Windows.Forms.TreeView control behave the same way.

...

If you take a further look at the explorer TreeView you’ll notice that in addition to the autoscroll functionality previously described, there are also some aesthetic changes.

...

So I was looking at how I can make my managed TreeView have the same feel and look.

...

I have updated the two code files, which I posted last time, to incorporate these additions ..."

Daniel provides cool tips and code (C#) to help you make the default/in-the-box .Net Treeview look much more "Vista like" (when running on Vista)...

Using my now officially favorite code converter (C# 2 to VB.Net / Boo or VB.Net to C# / Boo), code converter by SharpDevelop, I was able to take Daniel's code, convert it and get it running in a VB.Net app in minutes.

Here's the Before and After at design time...

..and runtime

No comments: