Click here to Skip to main content
6,292,426 members and growing! (10,406 online)
Email Password   helpLost your password?
Desktop Development » Tabs & Property Pages » Tabs and Property Pages     Intermediate License: The Code Project Open License (CPOL)

Visual Studio TabStrip

By Jared James Sullivan

A TabStrip control as seen in Visual Studio 2008.
C# (C# 2.0, C# 3.0), VB (VB 8.0, VB 9.0), Windows (Win2K, WinXP, Win2003, Vista), .NET (.NET 2.0, .NET 3.0, .NET 3.5), Win32, Visual Studio (VS2008), GDI, GDI+, Dev
Posted:18 Jan 2008
Updated:19 Jan 2008
Views:23,471
Bookmarked:54 times
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
7 votes for this article.
Popularity: 3.60 Rating: 4.26 out of 5
1 vote, 14.3%
1

2
2 votes, 28.6%
3

4
4 votes, 57.1%
5

xSliderV2.jpg

Introduction

I have replicated Visual Studio's vertical TabStrip control from the ground up. This lightweight control doesn't have containers which you can dump controls onto, as I have created the control to be used with forms instead of containers. Enjoy this 173 code liner.

Background

I was looking at creating something similar to the VS2008 Property Pages. I started off by mimicking the exact look and feel.

Using the Code

There are four custom properties..

  • Tabs()
  • TabHeight
  • Hover
  • Selected

There are two custom events..

  • ItemHover
  • SelectedIndexChanged

Simply set the Tabs() property in the IDE, and adjust TabHeight, if desired. From there, you can catch the _SelectedIndexChanged event at runtime.

Private Sub XSlider1_SelectedIndexChanged(ByVal eIndex As Integer) _
            Handles XSlider1.SelectedIndexChanged
  Trace.WriteLine(eIndex.ToString + " - " + Me.XSlider1.Tabs(eIndex).ToString)

End Sub

Points of Interest

The user has the option of docking the control to the left or right side of the form. Where Vista is installed, the font will snap to "Segoe UI".

History

  • 19-Jan-08 - Version 1 - submission.
  • 20-Jan-08 - Version 2 - five fixes.

License

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

About the Author

Jared James Sullivan


Member

Occupation: Software Developer
Company: ParadigmIT
Location: Australia Australia

Other popular Tabs & Property Pages articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 3 of 3 (Total in Forum: 3) (Refresh)FirstPrevNext
GeneralNice control Pinmember-tusk-8:27 20 Apr '08  
GeneralProblem Pinmemberenti3331:35 22 Jan '08  
GeneralRe: Problem Pinmember-tusk-8:20 20 Apr '08  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 19 Jan 2008
Editor: Smitha Vijayan
Copyright 2008 by Jared James Sullivan
Everything else Copyright © CodeProject, 1999-2009
Web19 | Advertise on the Code Project