# VBForums CodeBank > CodeBank - Visual Basic .NET >  [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)

## ForumAccount

Well, I finally had a chance to make this properly. It now acts like a TabControl. Meaning, each TabPage is actually a container that you can host controls. Not much needs explaining to use it. I attached a picture of a cool skin I made with it - the possibilities are limitless. (Ignore the tab names and File Browser, I couldn't really think of anything else for names or an example.)

I will, however, point a couple things out.

*1)* The previous version lacked this, and this version has it - the ability to increase the tab widths. Use the TabWidthInflation property for this. I created this because it was annoying if the text you wanted was to long for the tab.
*2)* The Skin property had a designer built for it, with a previewer and form to help create the skin easily, as opposed to browsing through the properties in the designer. A picture of it has been attached.
*3)* ImageList property, you can now associate images to the tab pages much like you would on any control (use an ImageList, and change the ImageKey property on the Tabs)

Many thanks to the suggestions from i00 and NickThissen, they were incorporated into this version. JuggaloBrotha, there is no LINQ, Initializer syntax or inferred objects in this, so it is fully compatible with VS2005 with Option Strict On, and I hope to see how you incorporate it into your application.  :Smilie: 

To use:

*1)* Add a reference to System.Design
*2)* Add the file via Project > Add Existing Item
*3)* Rebuild
*4)* The control will show up in your ToolBox.

Please do not steal this and claim it as yours...

*Update:* 12/05/2011 - See updated post - _Old Version_

*Update:* 12/07/2011 - See updated post - _Latest Version_

----------


## NickThissen

Very nice, looks identical in the XP silver theme. 

I understand that the PanelManager should be placed in the middle of the control manually? If so, perhaps a great improvement would be if you could only add controls to that section.

Right now, the designer inherits from ParentControlDesigner, so it can parent controls anywhere; even on top of the tabs. You could add a Panel in the middle (where the PanelManager is supposed to go) and only allow the user to add controls to that panel; not the entire control. This way, you can Dock the PanelManager into that panel, instead of having to anchor it. If you anchor it, it will occasionally slip out especially when resizing.

----------


## ForumAccount

That's a really good idea Nick that I didn't even think of. Thanks!

----------


## i00

great control ... just mod'ed it a bit so that it supports a transparent background

To do this I made the class:
- inherit from panel
- removed OnDrawParentColorArea as this painted the gradient out where the background was
- removed the BackColor property as it was not browsable
- mod'ed the OnDrawFillGradient sub to only draw within the bounds where the control actually needs to be painted

Also mod'ed the colors to use all standard Windows colors by default

And made it use high quality smoothing for everything except for the glyph as it looked bad for that

I have included a screen shot for those who want to see it

Kris

----------


## JuggaloBrotha

This is exactly what I'd like to use in my next version of one of my apps.  A number of NickThissen's controls will be used in it as well.  Keep up the good work guys.

----------


## Cyb3rH4Xter

How do i add this thingy to the toolbox? I downloaded the vb file and added to my solution, but how do i get it in my form? I also added reference to System.Design.

----------


## Cyb3rH4Xter

Oh, i saw how to do, i added the PanelManager.vb and VSTabControl.vb to my solution and compiled them, but i got 5 errors during the compile. I use VS10.

It seems to be missing an namespace import of a LINQ provider or a reference?

----------


## NickThissen

Is your project targeting the .NET framework 3.5 or higher?

----------


## Cyb3rH4Xter

Im using 4.0 framework.

----------


## Cyb3rH4Xter

oh sorry, i saw that my project used 2.0, it was 2.0 as defualt and i hadn't changed it. But i tested 4.0 and it dont work cause i cant find a reference to System.Design.

But then i chose 3.5, and now it works!  :Big Grin: 

But i cant get it to work so it changes panel when i click a tab. Yeah i saw you should use SelectedTabChanged, but how do i use it?

----------


## JuggaloBrotha

Ok well I've finally had a chance to check this out and it's an awesome control.  I would love to use this in an existing app in VS 2005, how hard would it be to do this without Linq and all that jazz?

Edit:  I've also noticed that the Tabs collection doesn't show in the properties window, only in the Tasks thing

----------


## ForumAccount

> Ok well I've finally had a chance to check this out and it's an awesome control.  I would love to use this in an existing app in VS 2005, how hard would it be to do this without Linq and all that jazz?
> 
> Edit:  I've also noticed that the Tabs collection doesn't show in the properties window, only in the Tasks thing


The Linq is easy to replace in it, just For Loops really.

The Tabs collection wasn't showing because for some reason I placed the Browsable(False) attribute over it. You can replace the Tabs property declaration with this:


vb.net Code:
Private _Tabs As SideTabCollection
    <DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Browsable(True)> _
    Public ReadOnly Property Tabs() As SideTabCollection
        Get
            Me.Invalidate()
            Return _Tabs
        End Get
    End Property

To get it to show.

I'm sure one day I'll eventually look at this control again and make it better.

----------


## JuggaloBrotha

> The Linq is easy to replace in it, just For Loops really.
> 
> The Tabs collection wasn't showing because for some reason I placed the Browsable(False) attribute over it. You can replace the Tabs property declaration with this:
> 
> 
> vb.net Code:
> Private _Tabs As SideTabCollection
>     <DesignerSerializationVisibility(DesignerSerializationVisibility.Content), Browsable(True)> _
>     Public ReadOnly Property Tabs() As SideTabCollection
> ...


Ah ok, that sounds easy enough, perhaps I'll eventually get it VS 2005 compatible.

I've also noticed that the tab pages aren't containers at all either, unless there's something I'm missing.  It seems kind of like a pain to have to handle a bunch of panels because of these tab pages not being containers.

----------


## ForumAccount

> Ah ok, that sounds easy enough, perhaps I'll eventually get it VS 2005 compatible.
> 
> I've also noticed that the tab pages aren't containers at all either, unless there's something I'm missing.  It seems kind of like a pain to have to handle a bunch of panels because of these tab pages not being containers.


Yeah I'm actually pretty bored right now so I decided to work on version 2 which will handle that. Basically it will act like the already familiar TabControl.

Edit:

I'll make it without Linq also.

----------


## JuggaloBrotha

> Yeah I'm actually pretty bored right now so I decided to work on version 2 which will handle that. Basically it will act like the already familiar TabControl.
> 
> Edit:
> 
> I'll make it without Linq also.


Well thanks, that would be awesome.

----------


## ForumAccount

Updated, original post was modified with the new content, enjoy!

----------


## boops boops

Hi ForumAccount,

Thanks for this excellent tab control. I have just been trying it out for a while and I have run into a couple of questions:

1. I'd like to make the InnerBackColor of the pages partly transparent but when I specify a transparent ARGB in the skin designer they remain opaque. Is it possible to change this -- perhaps even use a gradient for the page backgrounds?

2. I can't change the skin name, either in the VS properties window or in the skin designer.

I hope I haven't missed obvious answers to these but that is always possible.

cheers, BB

----------


## ForumAccount

1. I'll take a look
2. What do you mean? There is no skin name. It might be deceiving because in the VS properties window it shows "VisualStudiosTabControlSkin" but that is not it's name that is the type of object it is.

----------


## boops boops

Re 1: That would be wonderful!

Re 2: What I would really like to know is the best way to save a skin for use in other projects. Something will possibly occur to me after a night's sleep, but if you have a suggestion I'd be glad to hear it.

thanks again, BB

----------


## ForumAccount

> Re 2: What I would really like to know is the best way to save a skin for use in other projects. Something will possibly occur to me after a night's sleep, but if you have a suggestion I'd be glad to hear it.
> 
> thanks again, BB


Xml probably, I could write something for that...

----------


## NickThissen

If the VisualStudiosTabControlSkin property returns an instance of a class that contains the properties (which is what I'm guessing, though I'm not totally sure) then you can serialize and deserialize that class instance to load and save. I'm doing the same thing in my customizable toolstrip control (in the AppearanceControl designer), I think you even replied in my thread about that :P.
Not sure if I ever posted the solution there, but you do need to take into account the fact that you cannot serialize colors, so you'll have to create an integer (for example) property for every color property and do something like this


```
Private _SomeColor As Color
<XmlIgnore()> _
Public Property SomeColor() As Color
   Get
      Return _SomeColor
   End Get
   Set(ByVal value As Color)
      _SomeColor = value
   End Set
End Property

Public Property intSomeColor() As Integer
   Get
      Return Me.SomeColor.ToArgb()
   End Get
   Set(ByVal value As Integer)
      Me.SomeColor = Color.FromArgb(value)
   End Set
End Property
```

----------


## ForumAccount

The only problem is that my Skin class does not have a parameterless constructor. So I cannot serialize it that way. I would have to serialize/deserialize it manually (write the Xml document myself).

----------


## NickThissen

What arguments does it take then? My class didn't have one either, so I just created one for the serialization. I then made a new method to which I could pass the (usually constructor) arguments anyway after deserialization is completed.

----------


## ForumAccount

> What arguments does it take then? My class didn't have one either, so I just created one for the serialization. I then made a new method to which I could pass the (usually constructor) arguments anyway after deserialization is completed.


Probably the same as yours. It took an owner parameter. Owner = The control (VisualStudiosTabControl). I suppose I could do the same and add a parameterless constructor.

----------


## coolcurrent4u

> great control ... just mod'ed it a bit so that it supports a transparent background
> 
> To do this I made the class:
> - inherit from panel
> - removed OnDrawParentColorArea as this painted the gradient out where the background was
> - removed the BackColor property as it was not browsable
> - mod'ed the OnDrawFillGradient sub to only draw within the bounds where the control actually needs to be painted
> 
> Also mod'ed the colors to use all standard Windows colors by default
> ...


am using vs2005, and i get this error when i include your control as a existing item and try to run the program

----------


## i00

coolcurrent4u - by the look of your error console I use linq

thats not supported in vs2005

----------


## i00

good improvements in the updates - 
if this were my control i would i would do 2 things:
- would like to see some other way to show tabs that don't fit instead of menus (ie move the items up and down someway), maybe like menus do if you cannot fit the all the menu items animated would be good  :Smilie: .
- and also make the tabs drag reorderable

Just my two cents - great work though - 5 Stars

Also in preference to having custom colors defined i would recommend using the built in system colors by default

Great work
Regards
Kris

----------


## coolcurrent4u

> coolcurrent4u - by the look of your error console I use linq
> 
> thats not supported in vs2005


so what do you suggest i do?

----------


## JuggaloBrotha

I have VS 2005 and here's what I did.

I created a new WinForms project.
I added the VSTab control file to the project.
I added a reference to System.Design.
I built the project.
I went back to the form, dragged and dropped a VSTabControl from the toolbox onto the form.
I added a label to each tab.
I ran the project and verified that it works.

I've attached my VS2005 project to this post, check it out.

----------


## coolcurrent4u

See what i got after running your code

----------


## JuggaloBrotha

Just now I downloaded the zip file, extracted the contents, double clicked the solution file and it opened just fine in VS 2005 Pro, I clicked Build -> Build Solution, I then clicked the green "run" button and the form popped up with the VS Tab Control and everything, just as I had made it a few days ago.

Since it works and the steps are extremely simple, I don't know what to suggest to you.

----------


## ForumAccount

@coolcurrent4u, read your warnings, it's asking you to build the project. Build and run as JuggaloBrotha said.

----------


## coolcurrent4u

> Well, I finally had a chance to make this properly. It now acts like a TabControl. Meaning, each TabPage is actually a container that you can host controls. Not much needs explaining to use it. I attached a picture of a cool skin I made with it - the possibilities are limitless. (Ignore the tab names and File Browser, I couldn't really think of anything else for names or an example.)
> 
> I will, however, point a couple things out.
> 
> *1)* The previous version lacked this, and this version has it - the ability to increase the tab widths. Use the TabWidthInflation property for this. I created this because it was annoying if the text you wanted was to long for the tab.
> *2)* The Skin property had a designer built for it, with a previewer and form to help create the skin easily, as opposed to browsing through the properties in the designer. A picture of it has been attached.
> *3)* ImageList property, you can now associate images to the tab pages much like you would on any control (use an ImageList, and change the ImageKey property on the Tabs)
> 
> Many thanks to the suggestions from i00 and NickThissen, they were incorporated into this version. JuggaloBrotha, there is no LINQ, Initializer syntax or inferred objects in this, so it is fully compatible with VS2005 with Option Strict On, and I hope to see how you incorporate it into your application. 
> ...


The control looks transparent, or is it the form?
How can i make it transparent?

Thanks

----------


## dee-u

This is cool. Just in case, can I use it on any of my projects? What would be the license?

----------


## JuggaloBrotha

> The control looks transparent, or is it the form?
> How can i make it transparent?
> 
> Thanks


The control, except the actual tab pages (the square part on the right), can be transparent if you want it to be.  Set the colors to transparent in the designer.

----------


## coolcurrent4u

> @coolcurrent4u, read your warnings, it's asking you to build the project. Build and run as JuggaloBrotha said.


Thanks I did now, and it works like a charm

Thanks

----------


## ForumAccount

> This is cool. Just in case, can I use it on any of my projects? What would be the license?


Just credit I guess, I mean it's in here for people to use.  :Wink:

----------


## JuggaloBrotha

> Just credit I guess, I mean it's in here for people to use.


What?? I've already got it in 2 places in my current app and now I have to add your name to the about box?  That's a ridiculously high price >.<

 :Stick Out Tongue: 
Have you gotten my PM from a few weeks with those screenshots?

----------


## ForumAccount

> What?? I've already got it in 2 places in my current app and now I have to add your name to the about box?  That's a ridiculously high price >.<


LOL




> Have you gotten my PM from a few weeks with those screenshots?


Yeah I did, thanks for that. It was cool to see.

----------


## DragonRose

Hi, i followed the steps listed under VS 2008, but the control is not appearing in the tool box and im getting these errors:

----------


## ForumAccount

What version of the framework are you targeting?

----------


## DragonRose

3.5, i just made a new test project and tried adding the tab to that, using the same steps and it worked, so there must be a control in my main project which is conflicting with this, the only non standard controls i have are telerik rad controls, could be that.

----------


## Andynonymous

Hey guys I've used this tab control and it works pretty well. Thanks for your efforts so far!

However (theres always a however) I'm trying to add a control to a tab page and then add the page to the tabcontrol, the tabpage is added to the tabcontrol, but is blank. When there should be a form embedded. Heres the relevant code...



```
 
'##### PUPIL SEARCH RESULTS TAB CREATION #####
        Dim PupilDetailsTab As New CLDW.VisualStudiosTabControl.VisualStudiosTabPage

      
        Dim PupilDetailControlForm As New PupilDetailsControl 
        PupilDetailsTab.Controls.Add(PupilDetailControlForm)
       
 PupilDetailsTab.Name = "PupilDetails" & dgvPupilSearch.CurrentRow.Cells(11).Value
       
        Dim strSQLRT As String = "select * from tb_pupil where pupilid =" & dgvPupilSearch.CurrentRow.Cells(11).Value
        Dim dataAdapterRT As New SqlClient.SqlDataAdapter(strSQLRT, con)
        Dim dsRTData As DataSet
        Dim table As New DataTable
        dataAdapterRT.Fill(table)

        dsRTData = New DataSet()
        dataAdapterRT.Fill(dsRTData, "RTData")

        For Each row As DataRow In table.Rows

            PupilDetailControlForm.PupilFirstNameTextBox.Text = row.Item("pupilFirstName").ToString  'datarow 'SBCPupil_MattDataSet.sp_GetPupilContact(PupilID))
            PupilDetailControlForm.PupilLastNameTextBox.Text = row.Item("pupillastName").ToString
            PupilDetailControlForm.PupilMiddleNameTextBox.Text = row.Item("pupilmiddleName").ToString
            PupilDetailControlForm.PupilDOBTextBox.Text = row.Item("pupildob").ToString
            PupilDetailControlForm.PupilGenderTextBox.Text = row.Item("pupilgender").ToString
            PupilDetailControlForm.PupilPreviousLastNameTextBox.Text = row.Item("pupilpreviouslastName").ToString
            PupilDetailControlForm.PupilPreferedLastNameTextBox.Text = row.Item("pupilpreferedlastName").ToString
            PupilDetailsTab.Text = row.Item("pupilFirstName").ToString & " " & row.Item("pupillastName").ToString

        Next

        PupilDetailsTab.Controls.Add(PupilDetailControlForm)
        VisualStudiostabcontrol1.Controls.Add(PupilDetailsTab)
```

I'm guessing that 


```
PupilDetailsTab.Controls.Add(PupilDetailControlForm)
```

is not doing what I expect it to, so has anyone got any tips that might get it to work? Thanks in advance!

This is using VS 2005.

----------


## minitech

Your "cool skin" is amazing! Since JuggaloBrotha doesn't like my TabControl's default colors, I think I'll switch to that.

----------


## JuggaloBrotha

> Your "cool skin" is amazing! Since JuggaloBrotha doesn't like my TabControl's default colors, I think I'll switch to that.


I merely made a comment about it, I didn't mean to offend anyone.  The only issue I had was that it crashed the first time I used it, but that's been fixed so I have no complaints about it.

----------


## minitech

Even so, you don't like it. I aim to please other users, as I can keep the original version if I like. I think more people would prefer that Black/Transparent style.

Anyways, off topic!  :Smilie:

----------


## cops

cool man...thanks for sharing..
can i use it to my projects ? i'll credits ur name " ForumAccount from Vbforums "... hiahiahiah

----------


## akhileshbc

This is an awesome control.  :Thumb: 

But can you add a property for changing the heights of each Tab, in the next version ?

Thanks... :wave:

----------


## SirPereira

Hello, this sounds as a great control.

Is this fully compatible with VS2010 if we change the framework to 3.5?

----------


## NickThissen

> Hello, this sounds as a great control.
> 
> Is this fully compatible with VS2010 if we change the framework to 3.5?


Of course, typically, the .NET Framework is completely backward compatible, meaning anything that works in lesser versions will work just fine in newer versions.

----------


## minitech

In VS 2010, I couldn't find the System.Design reference in the first place so I got it from C:\WINDOWS\assembly\GAC\System.Design\ (probably a bad idea) and now I have 8 errors for undefined types, all the same on different lines:


```
Type "DesignerActionUIService" is not defined
```

and 2 of these:
InitializeNewComponent is not a member of System.Windows.Forms.ScrollableControlDesigner.

Why would I have to change it to 3.5 just to get it to work? Isn't it all backwards-compatible??

----------


## NickThissen

You are probably using an old version of the System.Design.dll file. I've found the same behavior though: it doesn't seem to be in the list when you are filtering on .NET 4.0. I think you can change the filter somewhere so that it shows all files and not just those for .NET 4.0. Not sure if it's a bug that it's not in the list, but you should use the latest System.Design.dll file and not an older one.


EDIT
Now that I've tried it on my new install (I formatted this weekend), I remember that it was because I was using some kind of 'power tools' extension for visual studio. It displayed a slightly different 'Add Reference' window (more in the style of VS2010), and for some reason it doesn't show all DLLs properly.

----------


## minitech

Okay. For now, I'm just switching to 3.5 because that's the only way to change the filter... kind of stupid, don't you think?

EDIT: It's still not there. This is why I didn't want to leave VS 2005  :Smilie:

----------


## NickThissen

Hm, the problem doesn't seem to be related to the 'powercommands' extension after all. In fact, the powercommands extension wasn't even the one that caused my 'Add Reference' window to look different (I must have had another extension installed, I can't remember). I am seeing the same problem now: in a new VB winforms project, System.Design.dll is not in the list. Strange! I've seen this before, and I've been able to solve this before, but I cannot remember how  :Frown:  I'm sure I'm going to need it soon enough though so I'll probably get back to this then lol...

Can't you switch to .NET 3.5, add the reference, and then switch back to 4.0?

----------


## minitech

No, the reference does not appear in .NET 3.5 either.

----------


## raineym

I'm using this in a project of mine and I receive this error at random intervals throughout the design and coding process, although it does build and run fine. It just causes me to save and close the project to get the TabControl to show back up in the Design window.

----------


## Xoslize

Hi guys, I'm having some problems..
How do I add the System.Design thingy? Please explain.
Make am ini guide howt ot add each thing please

----------


## NickThissen

> Hi guys, I'm having some problems..
> How do I add the System.Design thingy? Please explain.
> Make am ini guide howt ot add each thing please


Make sure your project is targeting .NET Framework 2.0, 3.5 or 4.0, and not 'Client Profile'. You can change this in the project Properties, click the Advanced Compile Options button under the Compile tab.Rightclick the project node in the solution explorer and choose Add ReferenceBrowse to System.Design.dll and click OK or Add or whatever the button is called.

----------


## ForumAccount

> I'm using this in a project of mine and I receive this error at random intervals throughout the design and coding process, although it does build and run fine. It just causes me to save and close the project to get the TabControl to show back up in the Design window.


In the OnDrawTabContent method change this part (510-512):

vb.net Code:
Dim image As Image = Me._ImageList.Images(tab.ImageKey)increase = image.Width - 4e.Graphics.DrawImage(image, New Rectangle(6, _                  CInt(location.Y + image.Height / 2), 16, 16))
To:

vb.net Code:
Dim image As Image = Me._ImageList.Images(tab.ImageKey)If image IsNot Nothing Then    increase = image.Width - 4    e.Graphics.DrawImage(image, New Rectangle(6, _                  CInt(location.Y + image.Height / 2), 16, 16))End If

This is untested, but based off your error message I'm quite certain it will fix it.

----------


## raineym

Thanks. I'll try it.

Also, I've noticed that at run-time, the tabs rearrange themselves.

For instance, if I have _TabOne, TabTwo, TabThree_, and _TabFour_ (in that order) in design-time, it will order them to _TabTwo, TabThree, TabOne_ and _TabFour_. Even if I reorder the tabs in design-time, it always puts them in this order at run-time: 2, 3, 1, 4.

It worked fine until I added the fourth tab, then even if I removed the tab, it still did it.

Its not a big deal since the order of the tabs in my app is not a big deal. Just thought I'd mention it.

----------


## ForumAccount

> Thanks. I'll try it.
> 
> Also, I've noticed that at run-time, the tabs rearrange themselves.
> 
> For instance, if I have _TabOne, TabTwo, TabThree_, and _TabFour_ (in that order) in design-time, it will order them to _TabTwo, TabThree, TabOne_ and _TabFour_. Even if I reorder the tabs in design-time, it always puts them in this order at run-time: 2, 3, 1, 4.
> 
> It worked fine until I added the fourth tab, then even if I removed the tab, it still did it.
> 
> Its not a big deal since the order of the tabs in my app is not a big deal. Just thought I'd mention it.


Take a look at the designer generated code, it's probably adding the tabs in that order (2, 3, 1, 4)... If you change the designer code to the order you want it should work.

----------


## raineym

From the code, they are in the correct order.


vb Code:
'
    'tcPodLoader
    '
    Me.tcPodLoader.Controls.Add(Me.tcPodLoaderTabPodcasts)
    Me.tcPodLoader.Controls.Add(Me.tcPodLoaderTabDownloads)
    Me.tcPodLoader.Controls.Add(Me.tcPodLoaderTabPlayer)
    Me.tcPodLoader.Controls.Add(Me.tcPodLoaderTabOptions)
    Me.tcPodLoader.ImageList = Me.ilPodLoaderTabControl
    Me.tcPodLoader.Location = New System.Drawing.Point(1, 2)
    Me.tcPodLoader.Name = "tcPodLoader"
    Me.tcPodLoader.SelectedTabPage = Me.tcPodLoaderTabOptions
    Me.tcPodLoader.Size = New System.Drawing.Size(698, 375)
    Me.tcPodLoader.Skin.TabControl.DividerSkin.BottomColor = System.Drawing.Color.FromArgb(CType(CType(222, Byte), Integer), CType(CType(222, Byte), Integer), CType(CType(229, Byte), Integer))
    Me.tcPodLoader.Skin.TabControl.DividerSkin.DrawDividers = True
    Me.tcPodLoader.Skin.TabControl.DividerSkin.TopColor = System.Drawing.Color.White
    Me.tcPodLoader.Skin.TabControl.GlyphSkin.GlyphBorderColor = System.Drawing.Color.FromArgb(CType(CType(75, Byte), Integer), CType(CType(75, Byte), Integer), CType(CType(111, Byte), Integer))
    Me.tcPodLoader.Skin.TabControl.GlyphSkin.GlyphColor = System.Drawing.Color.Black
    Me.tcPodLoader.Skin.TabControl.GlyphSkin.GlyphHighlightColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(238, Byte), Integer), CType(CType(194, Byte), Integer))
    Me.tcPodLoader.Skin.TabControl.InnerBackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(223, Byte), Integer), CType(CType(227, Byte), Integer))
    Me.tcPodLoader.Skin.TabControl.InnerBorderColor = System.Drawing.Color.FromArgb(CType(CType(131, Byte), Integer), CType(CType(151, Byte), Integer), CType(CType(162, Byte), Integer))
    Me.tcPodLoader.Skin.TabControl.OuterBackColor = System.Drawing.Color.FromArgb(CType(CType(214, Byte), Integer), CType(CType(214, Byte), Integer), CType(CType(222, Byte), Integer))
    Me.tcPodLoader.Skin.TabControl.OuterBorderColor = System.Drawing.Color.FromArgb(CType(CType(145, Byte), Integer), CType(CType(167, Byte), Integer), CType(CType(180, Byte), Integer))
    Me.tcPodLoader.Skin.TabPage.MouseHoverTabPage.FontSettings.Font = New System.Drawing.Font("Tahoma", 8.25!)
    Me.tcPodLoader.Skin.TabPage.MouseHoverTabPage.FontSettings.FontColor = System.Drawing.SystemColors.ControlText
    Me.tcPodLoader.Skin.TabPage.MouseHoverTabPage.GradientSettings.EndColor = System.Drawing.Color.FromArgb(CType(CType(214, Byte), Integer), CType(CType(214, Byte), Integer), CType(CType(222, Byte), Integer))
    Me.tcPodLoader.Skin.TabPage.MouseHoverTabPage.GradientSettings.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Horizontal
    Me.tcPodLoader.Skin.TabPage.MouseHoverTabPage.GradientSettings.StartColor = System.Drawing.Color.White
    Me.tcPodLoader.Skin.TabPage.MouseHoverTabPage.TabBorderColor = System.Drawing.Color.FromArgb(CType(CType(145, Byte), Integer), CType(CType(155, Byte), Integer), CType(CType(156, Byte), Integer))
    Me.tcPodLoader.Skin.TabPage.MouseHoverTabPage.TabRightBorderColor = System.Drawing.Color.FromArgb(CType(CType(131, Byte), Integer), CType(CType(151, Byte), Integer), CType(CType(162, Byte), Integer))
    Me.tcPodLoader.Skin.TabPage.MouseHoverTabPage.TabTipColor = System.Drawing.Color.FromArgb(CType(CType(230, Byte), Integer), CType(CType(139, Byte), Integer), CType(CType(44, Byte), Integer))
    Me.tcPodLoader.Skin.TabPage.MouseHoverTabPage.TabTipInnerColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(199, Byte), Integer), CType(CType(60, Byte), Integer))
    Me.tcPodLoader.Skin.TabPage.SelectedTabPage.FontSettings.Font = New System.Drawing.Font("Tahoma", 8.25!)
    Me.tcPodLoader.Skin.TabPage.SelectedTabPage.FontSettings.FontColor = System.Drawing.SystemColors.ControlText
    Me.tcPodLoader.Skin.TabPage.SelectedTabPage.GradientSettings.EndColor = System.Drawing.Color.White
    Me.tcPodLoader.Skin.TabPage.SelectedTabPage.GradientSettings.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Horizontal
    Me.tcPodLoader.Skin.TabPage.SelectedTabPage.GradientSettings.StartColor = System.Drawing.Color.White
    Me.tcPodLoader.Skin.TabPage.SelectedTabPage.TabBorderColor = System.Drawing.Color.FromArgb(CType(CType(145, Byte), Integer), CType(CType(155, Byte), Integer), CType(CType(156, Byte), Integer))
    Me.tcPodLoader.Skin.TabPage.SelectedTabPage.TabRightBorderColor = System.Drawing.Color.FromArgb(CType(CType(173, Byte), Integer), CType(CType(190, Byte), Integer), CType(CType(204, Byte), Integer))
    Me.tcPodLoader.Skin.TabPage.SelectedTabPage.TabTipColor = System.Drawing.Color.FromArgb(CType(CType(230, Byte), Integer), CType(CType(139, Byte), Integer), CType(CType(44, Byte), Integer))
    Me.tcPodLoader.Skin.TabPage.SelectedTabPage.TabTipInnerColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(199, Byte), Integer), CType(CType(60, Byte), Integer))
    Me.tcPodLoader.Skin.TabPage.UnselectedTabPage.FontSettings.Font = New System.Drawing.Font("Tahoma", 8.25!)
    Me.tcPodLoader.Skin.TabPage.UnselectedTabPage.FontSettings.FontColor = System.Drawing.SystemColors.ControlText
    Me.tcPodLoader.Skin.TabPage.UnselectedTabPage.GradientSettings.EndColor = System.Drawing.Color.FromArgb(CType(CType(214, Byte), Integer), CType(CType(214, Byte), Integer), CType(CType(222, Byte), Integer))
    Me.tcPodLoader.Skin.TabPage.UnselectedTabPage.GradientSettings.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Horizontal
    Me.tcPodLoader.Skin.TabPage.UnselectedTabPage.GradientSettings.StartColor = System.Drawing.Color.White
    Me.tcPodLoader.TabIndex = 0

I moved the Friend lines and put them in the order I wanted them and still nothing.


vb Code:
Friend tcPodLoaderTabPodcasts As PodLoader.VisualStudiosTabControl.VisualStudiosTabPage
  Friend tcPodLoaderTabDownloads As PodLoader.VisualStudiosTabControl.VisualStudiosTabPage
  Friend tcPodLoaderTabPlayer As PodLoader.VisualStudiosTabControl.VisualStudiosTabPage
  Friend tcPodLoaderTabOptions As PodLoader.VisualStudiosTabControl.VisualStudiosTabPage

----------


## Xoslize

Warning	1	Could not find type 'WindowsApplication1.VisualStudiosTabControl+VisualStudiosTabControlSkin'.  Please make sure that the assembly that contains this type is referenced.  If this type is a part of your development project, make sure that the project has been successfully built using settings for your current platform or Any CPU.		0	0	
Warning	2	Method 'System.Windows.Forms.Panel.SetStyle' not found.	C:\Users\WireZ\documents\visual studio 2010\Projects\WindowsApplication1\WindowsApplication1\VisualStudiosTabControl.vb	246	0	
Warning	3	Method 'System.Windows.Forms.Panel.SetStyle' not found.	C:\Users\WireZ\documents\visual studio 2010\Projects\WindowsApplication1\WindowsApplication1\VisualStudiosTabControl.vb	247	0	
Warning	4	Method 'System.Windows.Forms.Panel.SetStyle' not found.	C:\Users\WireZ\documents\visual studio 2010\Projects\WindowsApplication1\WindowsApplication1\VisualStudiosTabControl.vb	248	0	
Warning	5	Method 'System.Windows.Forms.Panel.SetStyle' not found.	C:\Users\WireZ\documents\visual studio 2010\Projects\WindowsApplication1\WindowsApplication1\VisualStudiosTabControl.vb	249	0	
Warning	6	Function 'IsValueAllowed' doesn't return a value on all code paths. Are you missing a 'Return' statement?	C:\Users\WireZ\documents\visual studio 2010\Projects\WindowsApplication1\WindowsApplication1\VisualStudiosTabControl.vb	1402	9	WindowsApplication1


all the error i get.

----------


## jjohns

I am using Visual Basic 2010 Ultimate to design a simple project. I need to design a vertical Tab control and on trying to search the Net i found what your TabControlProperty is capable of, which is exactly what I need to do.
I downloaded the file and followed your instructions on how to use it but unfortunately it couldn't work for my project. Would you please help/advise me on how to make it work for my project?

jjohns

----------


## formlesstree4

> I am using Visual Basic 2010 Ultimate to design a simple project. I need to design a vertical Tab control and on trying to search the Net i found what your TabControlProperty is capable of, which is exactly what I need to do.
> I downloaded the file and followed your instructions on how to use it but unfortunately it couldn't work for my project. Would you please help/advise me on how to make it work for my project?
> 
> jjohns


Well, what didn't work? That's the most generic issue is that "It didn't work". Well, did you get any error messages? Did you Build the project once to make sure that Visual Studio recognized the attached DLL?

----------


## jjohns

I re-built the project as you instructed. After rebuilding it, there were more than 100 errors all over the project and I could access any of my forms anylonger. What I can remember is that one the error it gave was that "VisualStudiosTabControl.vb" is not an object of my project. I removed it from the project but still the whole  project was buggy and I had to restart it. I still want the VisualStudiosTabControl.vb any way. My be I will have to load it in one on my test projects capture some of the errors for you.

Thanks

----------


## ForumAccount

So you downloaded the file (the .vb file) and went into your project and chose: Project > Add Existing Item then you navigated to the file. Then you added it. Then you rebuilt the project and got errors? Please provide additional information such as:
Your target frameworkError information/details (what errors)Possible screen shotsReferences used in the project

----------


## eddie298

Everytime i rebuild it i have a couple warning. but it seems to work fine. i can't find the visualstudiostabcontrolskindesigner thing though. do you mind if i post a video on how i installed your tabcontroller to see if i did everything correct and you could also see the errors i get?

----------


## JuggaloBrotha

Seems a lot of people are having trouble adding the correct reference to the project, adding the tab control files to their project & finally adding the tabs they want, perhaps I should post a solution that they can just copy.

To produce this here's the steps I did in the order I did them:
Created a projectAdded the VSTabControl.vb file to the project
Right clicked the project name in solution explorerSelect AddSelect Existing ItemSelect the VSTabControl.vb fileAdded the System.Design dll reference to the project
Right click the project name in solution explorerSelect PropertiesSelect Reference (from the left side)Click addSelect ReferenceOn the .Net tab scroll down to System.DesignClick OKBuilt the project
On the build menu, select Build SolutionAdd the control to the form, two tabpages are there by defaultAdded the two labels, one to each tab
If you use the project I provided, you'll need to build the solution the first time you open the project so the form will display correctly.  I had to remove the binaries to post it here & when you open it the first time VS can't display the form correctly because none of the binaries are present yet.

----------


## ForumAccount

Updated the control so that the tab's heights could be changed. This is all done through the Inflation property. TabWidthInflation property has been removed.

Also fixed a couple bugs and glitches having to do with resizing and proper component selection from the designer.

See screenshot.

----------


## akhileshbc

> Updated the control so that the tab's heights could be changed. This is all done through the Inflation property. TabWidthInflation property has been removed.
> 
> Also fixed a couple bugs and glitches having to do with resizing and proper component selection from the designer.
> 
> See screenshot.


Like  :Thumb:

----------


## JuggaloBrotha

> Updated the control so that the tab's heights could be changed. This is all done through the Inflation property. TabWidthInflation property has been removed.
> 
> Also fixed a couple bugs and glitches having to do with resizing and proper component selection from the designer.
> 
> See screenshot.


One of the things I'm wondering if you could "fix" is whatever tab you have selected at design time is saved to the *.designer.* file, so at run time it's whatever tab you were working on last that's selected and not the first tab (index 0) like a regular tab control does.  Is there a way you can have it not save the SelectedIndex property at design time?

----------


## NickThissen

JB, you can stop a property from being serialized to the designer by adding a function ShouldSerialize<property> and return false. The designer will look for this property (and assume true if it doesn't exist). I don't know if ForumAccount has another solution in mind, but this could be a quick fix you can do yourself.

(In the control's class):


```
Private Function ShouldSerializeSelectedIndex() As Boolean
    Return False
End Function
```

----------


## ForumAccount

> One of the things I'm wondering if you could "fix" is whatever tab you have selected at design time is saved to the *.designer.* file, so at run time it's whatever tab you were working on last that's selected and not the first tab (index 0) like a regular tab control does.  Is there a way you can have it not save the SelectedIndex property at design time?


The control should already be serializing the SelectedTabPage to the designer file. When you change what page that is, it should change in the designer file. Can you confirm that it is not? Can you reproduce it? For me, what you describe, works.

----------


## JuggaloBrotha

> The control should already be serializing the SelectedTabPage to the designer file. When you change what page that is, it should change in the designer file. Can you confirm that it is not? Can you reproduce it? For me, what you describe, works.


I was asking for the opposite of that.

Currently it is putting it in the designer file, it always has been and I'm asking that you make it NOT save it in the designer file, like how a regular tab control works.

----------


## coolcurrent4u

Hello, can this tab orientation be change to top or bottom?

----------


## ForumAccount

> Hello, can this tab orientation be change to top or bottom?


No. I'll think about possibly doing that.



> I was asking for the opposite of that.


New version fixes that.

Updated the control again to properly implement the functionality of disabling a tab page. Disabling a tab page makes it so that a user cannot click the tab and the text and image will be drawn disabled. Logic has been added to select the first enabled tab page (starting at index 0) of the tab control at run time.

Another thing: I changed the naming scheme from _VisualStudios*_ to _VisualStudio*_

----------


## gonks

ForumAccount you really are amazing! I'm using your tabcontrol as a user control from a c# project and it really rocks!

I'd like to know if there's a way of selecting a tabpage programatically, since asigning the SelectedTabPage or SelectedIndex properties doesn't seem to work.

Thanks for sharing such a useful control!

----------


## coolcurrent4u

Hello, is it possible to set the size of the tab buttons, possible up to the height of that of visual studio
Also is it possible to use icons other that 16, possibly 24 etc

----------


## gonks

> ForumAccount you really are amazing! I'm using your tabcontrol as a user control from a c# project and it really rocks!
> 
> I'd like to know if there's a way of selecting a tabpage programatically, since asigning the SelectedTabPage or SelectedIndex properties doesn't seem to work.
> 
> Thanks for sharing such a useful control!


Nevermind, i've already figured out what i was doing wrong. Asigning the SelectedTabPage property works like a charm!

Greets from Argentina!

----------


## crazym1ke

> ForumAccount you really are amazing! I'm using your tabcontrol as a user control from a c# project and it really rocks!
> 
> I'd like to know if there's a way of selecting a tabpage programatically, since asigning the SelectedTabPage or SelectedIndex properties doesn't seem to work.
> 
> Thanks for sharing such a useful control!


How can I use the Vb-File in a C# project? I got a C# Project but can't figure out how to use the file...

----------


## minitech

> How can I use the Vb-File in a C# project? I got a C# Project but can't figure out how to use the file...


You can either compile it into an assembly and reference that, or you can convert it.

----------


## Zius

i hope ForumAccount  still here his great tabcontrol was the reason i knew about this great forum ,so if you still here could you please add 'right to left' property to the tabcontrol , or if someone know how to do it please help me

----------


## Obaralic

I'm having really hard time with this VSTabControl and C#.
I've tried to convert it to .cs and use that file as specified with instructions but with no success!
Could someone explain me how to compile it into an assembly and reference that?

----------


## chrisTemper

This is really awesome... but I don't how to apply those class I download in my code T_T... I create a new just to see if I can do it...

I create a new windows form application and create a new class(with those I downloaded) ... But sadly I fail... (sigh) is there any instruction how to apply those class?...


(edit)

I already solved my problem... thanks for this... I will credit you sir on my project...  :Smilie: )

----------


## Arve K.

ForumAccount,

Downloaded and tested your control today. Awesome work!  :Thumb:   :Smilie:

----------


## Tottes81

Hi, I really like your VSTabControl. It represent exactly what i am looking for. I've tested it in a vb project and it works fine for me.
There is just one issue for me ( a big one). I am now working in a C# project and i want to know how to do to use this vb component in a c# project.
Thanks.

----------


## dannycal

> Updated the control so that the tab's heights could be changed. This is all done through the Inflation property. TabWidthInflation property has been removed.
> 
> Also fixed a couple bugs and glitches having to do with resizing and proper component selection from the designer.
> 
> See screenshot.


Why won't this .vb file download when clicked on. If I try to download the file is attachment.php

----------


## akhileshbc

> Why won't this .vb file download when clicked on. If I try to download the file is attachment.php


I believe there is some trouble with your internet connection or probably some problem with VBF servers (but am not experiencing any issues while downloading it).

So, try again after some time.  :Thumb:

----------


## phpman

Love this control, but when I try to make the whole thing transparent like it shows in the first post, it gets really weird on me and labels from the other tabs start to bleed through. did i miss an easy step? I also can't see how to make the tabs transparent.

oh an dhow do you call a specific tab?

 FrmMain.VisualStudioTabControl1.SelectTab(5)

doesn't work

----------


## JuggaloBrotha

> Love this control, but when I try to make the whole thing transparent like it shows in the first post, it gets really weird on me and labels from the other tabs start to bleed through. did i miss an easy step? I also can't see how to make the tabs transparent.
> 
> oh an dhow do you call a specific tab?
> 
>  FrmMain.VisualStudioTabControl1.SelectTab(5)
> 
> doesn't work


The way I select a specific tab in code is:

vb Code:
VsTabControl1.SelectedTabPage = SpecifcVisualStudiosTabPage

----------


## phpman

Thanks JuggalBrotha, but it still doesn't like anything after the = sign



vb Code:
FrmMain.VisualStudioTabControl1.SelectedTabPage = VisualStudiosTabPage6FrmMain.VisualStudioTabControl1.SelectedTabPage = "NameofTab"

----------


## JuggaloBrotha

> Thanks JuggalBrotha, but it still doesn't like anything after the = sign
> 
> vb Code:
> FrmMain.VisualStudioTabControl1.SelectedTabPage = VisualStudiosTabPage6


I'm unable to replicate this, setting the SelectedTabPage property to the TabPage object itself works for me in both VS2008 (Targeting .Net 2.0) and VS2010 (Targeting .Net 4.0)

----------


## techgnome

> Thanks JuggalBrotha, but it still doesn't like anything after the = sign
> 
> 
> 
> vb Code:
> FrmMain.VisualStudioTabControl1.SelectedTabPage = VisualStudiosTabPage6FrmMain.VisualStudioTabControl1.SelectedTabPage = "NameofTab"


If it doesn't like it, then it must be giving you an error, right? What's the error message?

-tg

----------


## phpman

Sorry guys, error is:

VisualStudioTabPage6 is not declared. It maybe inaccessible due to its protection level.

Also, I can not see it in general drop down. I see VisualStudioTabControl1 but no tabs.

running VS2013 Express and .NET 4.5.1

----------


## phpman

Just a heads up, I can call the tabpage just fine from the main form, FrmMain,  just not from any other file

----------


## JuggaloBrotha

> Sorry guys, error is:
> 
> VisualStudioTabPage6 is not declared. It maybe inaccessible due to its protection level.
> 
> Also, I can not see it in general drop down. I see VisualStudioTabControl1 but no tabs.
> 
> running VS2013 Express and .NET 4.5.1


You have a scope issue, what I would recommend is you create an Enum for each of the tab pages on the form (set the Enum to Friend or Public), then create a function (friend or public) for changing the tabpage with the enum as a parameter.  In the function you use the enum to set the tab page.

----------


## phpman

Thanks JuggaloBrother, but please forgive me ignorance. I know how to setup a enum, but I am not understanding how to use the enum to set the tabpage. have an example that would be great.

----------


## JuggaloBrotha

> Thanks JuggaloBrother, but please forgive me ignorance. I know how to setup a enum, but I am not understanding how to use the enum to set the tabpage. have an example that would be great.


In the function you make to set the tab page you do a select case on the enum variable (or a bunch of If.. ElseIf's) and set the corresponding TabPage in that Case (or in the ElseIf).

----------


## i00

Ok ... here is my version ...

VisualStudiosTabControl.vb

I fixed the tab re-ordering thing ... I see that the poster tried to do this ... but they rely on tab names to do the ordering ... instead of the objects themselves, so if you dynamically add the tabs the tabs were still being incorrectly re-orderedUses windows color schemes (don't know why so many people want to make their own up!)SelectedTabChanging event added with the option to cancel the changeRemoved the TabTipInnerColor as I think it is pointlessChanged the tip and "hover border" rendering

Kris

----------


## Stumpii

Thanks for this control. It is just what I needed.

----------


## Felten

Hi!

I downloaded the VisualStudioTabControl.vb, added it to my project, added the System.Design reference and rebuilt but I can't fint it in the Toolbox.
I also get these three errors:
1 Type 'Dictionary' is not defined.
2 'element' is not declared. It may be inaccessible due to its protection level.
3 Type 'List' is not defined.

Any ideas?
I use VS2012

/Anders

----------


## Stumpii

> Hi!
> 
> I downloaded the VisualStudioTabControl.vb, added it to my project, added the System.Design reference and rebuilt but I can't fint it in the Toolbox.
> I also get these three errors:
> 1 Type 'Dictionary' is not defined.
> 2 'element' is not declared. It may be inaccessible due to its protection level.
> 3 Type 'List' is not defined.
> 
> /Anders


You may need to add a reference to 'System.Collections.Generic'.

----------


## mrnooo2000

Can the tabs direction changed to the right of the tabpages?

----------


## jpskiller

This is great

I am using the one modified by i00 

Are you able to change font and size of font on tab text, when I tried it made no difference

----------


## jpskiller

Does any one know how I could draw a line on a tabpage using this ta control

----------

