Click here to Skip to main content
13,398,338 members (34,941 online)
Click here to Skip to main content
Add your own
alternative version


83 bookmarked
Posted 10 Mar 2009

Vista Style Address Bar for .NET 2.0/WinForms

, 10 Apr 2010
Rate this:
Please Sign up or sign in to vote.
WinForms version of the Vista style address bar that can be extended to support more than just browsing the file system.


Whilst Windows Vista still sits in amidst much controversy and discussion, a few of the features/changes it implemented have been quite cool. However, Microsoft failed to really let slide some of the cool UI changes down to us normal (or student) developers.

This article/code sample contains a personal implementation of the Vista-Style address bar for use in .NET/WinForms applications. It's based around a simple Tree/Node traversal that can be inherited to browse whatever you like.

Included in the demo is an example implementation that browses the file system tree, though it is limited in functionality (it was only made to illustrate how it all works :)).

Using the Code

The easiest way to understand the code is to download it and open it and have a play about.

The simplest way to use the bar is to drop it onto your form in Design view, then in the constructor of your form add the following code:

//Initialize the bar with a root node type.
this.AdBar.InitializeRoot(new FileSystemNode());

All you need to do is pass it a root node, and the node itself should provide the information directly to the control. The FileSystemNode provides a basic enumeration of the first logical drive found on your Windows Install.

To implement the IAddressNode class, there are a few simple Properties to override and implement, then three real methods to implement yourself:

  • UpdateNode() - Used to update the node itself for any changes (e.g. in the FileSystemNode it checks for child folder changes and folder name changes)
  • GetChild() - Searches for a given child node based on a unique ID (A Unique ID being whatever you define it as. In FileSystemNode, we use an absolute path for a folder as the unique ID).
  • Clone() - Clones a given node as a separate value copy (rather than just by reference).


It's simple and relatively lightweight, it just needs you to implement your own IAddressNode derivatives to let it traverse any hierarchical structure you see fit. :)


  • 7/3/2009 - First upload of code to CodeProject
  • 29/12/2009 - Version 2.0 Supporting "My Computer" root node and VS2008, various bug fixes
  • 10/4/2010 - Version 2.1 Fix to overflow behaviour to make use of available space better. Slight optimization to overflow generation.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer
United Kingdom United Kingdom
A graduate of the University of Dundee, and an ex-Microsoft UK Support Engineer currently happily employed at Codemasters, Southam.

You may also be interested in...

Comments and Discussions

QuestionSHGetFileInfo error in FileSystemNode.GenerateNodeDisplayDetails Pin
black__cat1-Sep-16 8:35
memberblack__cat1-Sep-16 8:35 
Questioncomputernode rename Pin
Member 1021535017-Jan-14 6:36
memberMember 1021535017-Jan-14 6:36 
GeneralMy vote of 5 Pin
TG_Cid22-Nov-10 8:17
memberTG_Cid22-Nov-10 8:17 
Question[My vote of 1] Why is your demo's form not resizable? Pin
tonyt10-Apr-10 17:35
membertonyt10-Apr-10 17:35 
AnswerRe: [My vote of 1] Why is your demo's form not resizable? Pin
jwraith11-Apr-10 1:34
memberjwraith11-Apr-10 1:34 
GeneralRe: [My vote of 1] Why is your demo's form not resizable? Pin
tonyt11-Apr-10 13:57
membertonyt11-Apr-10 13:57 
GeneralRe: [My [revote of 5]] Why is your demo's form not resizable? Pin
tonyt7-May-10 2:37
membertonyt7-May-10 2:37 
GeneralOverflow problems Pin
see_seA1-Mar-10 12:14
membersee_seA1-Mar-10 12:14 
GeneralRe: Overflow problems Pin
jwraith10-Apr-10 5:20
memberjwraith10-Apr-10 5:20 
GeneralRe: Overflow problems Pin
jwraith10-Apr-10 7:09
memberjwraith10-Apr-10 7:09 
GeneralDoubleClick Pin
mikeduglas8-Jan-10 20:49
membermikeduglas8-Jan-10 20:49 
I noticed DoubleClick event never fires.
GeneralRe: DoubleClick Pin
jwraith10-Apr-10 5:21
memberjwraith10-Apr-10 5:21 
GeneralDropDowns Pin
tonyt29-Dec-09 15:41
membertonyt29-Dec-09 15:41 
GeneralRe: DropDowns Pin
jwraith30-Dec-09 3:07
memberjwraith30-Dec-09 3:07 
GeneralNull Reference Exception Pin
BenW26924-May-09 22:36
memberBenW26924-May-09 22:36 
GeneralRe: Null Reference Exception Pin
jwraith19-Dec-09 15:32
memberjwraith19-Dec-09 15:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.180216.1 | Last Updated 10 Apr 2010
Article Copyright 2009 by jwraith
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid