5,442,164 members and growing! (16,331 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# 3.0, C#, C# 2.0), VB (VB 8.0, VB 9.0, VB), Windows (Windows, Win2K, WinXP, Win2003, Vista), .NET (.NET 3.0, .NET, .NET 3.5, .NET 2.0), Win32, Visual Studio (VS2008, Visual Studio), GDI, GDI+, Dev

Posted: 18 Jan 2008
Updated: 19 Jan 2008
Views: 12,840
Bookmarked: 30 times
Announcements
Want a new Job?



Search    
Advanced Search
Sitemap
5 votes for this Article.
Popularity: 2.83 Rating: 4.05 out of 5
1 vote, 20.0%
1
0 votes, 0.0%
2
2 votes, 40.0%
3
0 votes, 0.0%
4
2 votes, 40.0%
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



Occupation: Software Developer
Location: Australia Australia

Other popular Tabs & Property Pages articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 3 of 3 (Total in Forum: 3) (Refresh)FirstPrevNext
Subject  Author Date 
GeneralNice controlmember-tusk-8:27 20 Apr '08  
GeneralProblemmemberenti3331:35 22 Jan '08  
GeneralRe: Problemmember-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-2008
Web07 | Advertise on the Code Project