[.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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.
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.
Re: [.NET 3.5+] Visual Studios "My Projects" Tab Control
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.
Re: [.NET 3.5+] Visual Studios "My Projects" Tab Control
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
Re: [.NET 3.5+] Visual Studios "My Projects" Tab Control
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.
Currently using VS 2015 Enterprise on Win10 Enterprise x64.
Re: [.NET 3.5+] Visual Studios "My Projects" Tab Control
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.
Re: [.NET 3.5+] Visual Studios "My Projects" Tab Control
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?
Re: [.NET 3.5+] Visual Studios "My Projects" Tab Control
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!
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?
Last edited by Cyb3rH4Xter; Nov 22nd, 2009 at 04:15 AM.
Re: [.NET 3.5+] Visual Studios "My Projects" Tab Control
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
Last edited by JuggaloBrotha; Dec 1st, 2009 at 11:48 AM.
Currently using VS 2015 Enterprise on Win10 Enterprise x64.
Re: [.NET 3.5+] Visual Studios "My Projects" Tab Control
Originally Posted by 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
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:
Re: [.NET 3.5+] Visual Studios "My Projects" Tab Control
Originally Posted by ForumAccount
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:
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.
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.
Currently using VS 2015 Enterprise on Win10 Enterprise x64.
Re: [.NET 3.5+] Visual Studios "My Projects" Tab Control
Originally Posted by JuggaloBrotha
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.
Re: [.NET 3.5+] Visual Studios "My Projects" Tab Control
Originally Posted by ForumAccount
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.
Currently using VS 2015 Enterprise on Win10 Enterprise x64.
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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.
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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.
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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.
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Originally Posted by boops boops
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.
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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
Code:
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
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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).
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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.
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Originally Posted by 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.
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.
Re: [.NET 3.5+] Visual Studios "My Projects" Tab Control
Originally Posted by 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
am using vs2005, and i get this error when i include your control as a existing item and try to run the program
Programming is all about good logic. Spend more time here
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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 .
- 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
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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.
Last edited by JuggaloBrotha; Jun 30th, 2010 at 03:05 PM.
Currently using VS 2015 Enterprise on Win10 Enterprise x64.
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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.
Currently using VS 2015 Enterprise on Win10 Enterprise x64.
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Originally Posted by 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.
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...
The control looks transparent, or is it the form?
How can i make it transparent?
Thanks
Programming is all about good logic. Spend more time here
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Originally Posted by coolcurrent4u
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.
Currently using VS 2015 Enterprise on Win10 Enterprise x64.