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.
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
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.
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
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
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 framework
- Error information/details (what errors)
- Possible screen shots
- References used in the project
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?
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 project
- Added the VSTabControl.vb file to the project
- Right clicked the project name in solution explorer
- Select Add
- Select Existing Item
- Select the VSTabControl.vb file
- Added the System.Design dll reference to the project
- Right click the project name in solution explorer
- Select Properties
- Select Reference (from the left side)
- Click add
- Select Reference
- On the .Net tab scroll down to System.Design
- Click OK
- Built the project
- On the build menu, select Build Solution
- Add the control to the form, two tabpages are there by default
- Added 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.
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?
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):
Code:Private Function ShouldSerializeSelectedIndex() As Boolean
Return False
End Function
Hello, can this tab orientation be change to top or bottom?
No. I'll think about possibly doing that.
New version fixes that.Quote:
Originally Posted by JuggaloBrotha
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*
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!
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
You can either compile it into an assembly and reference that, or you can convert it.
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
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?
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... :))
ForumAccount,
Downloaded and tested your control today. Awesome work! :thumb: :)
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.
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
Thanks JuggalBrotha, but it still doesn't like anything after the = sign
vb Code:
FrmMain.VisualStudioTabControl1.SelectedTabPage = VisualStudiosTabPage6 FrmMain.VisualStudioTabControl1.SelectedTabPage = "NameofTab"
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
Just a heads up, I can call the tabpage just fine from the main form, FrmMain, just not from any other file
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.
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.
Ok ... here is my version ...
Attachment 129157
- 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-ordered
- Uses 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 change
- Removed the TabTipInnerColor as I think it is pointless
- Changed the tip and "hover border" rendering
Kris
Thanks for this control. It is just what I needed.
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
Can the tabs direction changed to the right of the tabpages?
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
Does any one know how I could draw a line on a tabpage using this ta control