-
3 Attachment(s)
[.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.
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
-
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
That's a really good idea Nick that I didn't even think of. Thanks!
-
2 Attachment(s)
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
Kris
-
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.
-
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
Is your project targeting the .NET framework 3.5 or higher?
-
Re: [.NET 3.5+] Visual Studios "My Projects" Tab Control
-
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! :D
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?
-
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
-
Re: [.NET 3.5+] Visual Studios "My Projects" Tab Control
Quote:
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:
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.
-
Re: [.NET 3.5+] Visual Studios "My Projects" Tab Control
Quote:
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:
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.
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.
-
Re: [.NET 3.5+] Visual Studios "My Projects" Tab Control
Quote:
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.
Edit:
I'll make it without Linq also.
-
Re: [.NET 3.5+] Visual Studios "My Projects" Tab Control
Quote:
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.
-
Re: [.NET 2.0+] Visual Studios "My Projects" Tab Control (Updated! 12/9/2009)
Updated, original post was modified with the new content, enjoy!
-
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.
cheers, BB
-
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.
thanks again, BB
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Quote:
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.
thanks again, BB
Xml probably, I could write something for that...
-
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)
Quote:
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.
-
1 Attachment(s)
Re: [.NET 3.5+] Visual Studios "My Projects" Tab Control
Quote:
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
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
coolcurrent4u - by the look of your error console I use linq
thats not supported in vs2005
-
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
Great work
Regards
Kris
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Quote:
Originally Posted by
i00
coolcurrent4u - by the look of your error console I use linq
thats not supported in vs2005
so what do you suggest i do?
-
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.
-
1 Attachment(s)
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
See what i got after running your code
-
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.
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
@coolcurrent4u, read your warnings, it's asking you to build the project. Build and run as JuggaloBrotha said.
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Quote:
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
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
This is cool. Just in case, can I use it on any of my projects? What would be the license?
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Quote:
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.
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Quote:
Originally Posted by
ForumAccount
@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
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Quote:
Originally Posted by
dee-u
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. ;)
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Quote:
Originally Posted by
ForumAccount
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 >.<
:p
Have you gotten my PM from a few weeks with those screenshots?
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Quote:
Originally Posted by
JuggaloBrotha
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
Quote:
Originally Posted by
JuggaloBrotha
Have you gotten my PM from a few weeks with those screenshots?
Yeah I did, thanks for that. It was cool to see.
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Hi, i followed the steps listed under VS 2008, but the control is not appearing in the tool box and im getting these errors:
http://i972.photobucket.com/albums/a...01/Snap3-1.jpg
http://i972.photobucket.com/albums/a...e_01/Snap4.jpg
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
What version of the framework are you targeting?
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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.
-
Re: Veritcle Tab Control
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...
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
Code:
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.
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Your "cool skin" is amazing! Since JuggaloBrotha doesn't like my TabControl's default colors, I think I'll switch to that.
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Quote:
Originally Posted by
minitech
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.
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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! :)
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
cool man...thanks for sharing..
can i use it to my projects ? i'll credits ur name " ForumAccount from Vbforums "... hiahiahiah
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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:
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Hello, this sounds as a great control.
Is this fully compatible with VS2010 if we change the framework to 3.5?
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Quote:
Originally Posted by
SirPereira
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.
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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:
Code:
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??
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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.
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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 :)
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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 :( 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?
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
No, the reference does not appear in .NET 3.5 either.
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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.
http://i116.photobucket.com/albums/o...rolError-1.png
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Quote:
Originally Posted by
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
- 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 Reference
- Browse to System.Design.dll and click OK or Add or whatever the button is called.
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Quote:
Originally Posted by
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.
http://www.vbforums.com/images/ieimages/2010/12/1.png
In the OnDrawTabContent method change this part (510-512):
vb.net Code:
Dim image As Image = Me._ImageList.Images(tab.ImageKey)
increase = image.Width - 4
e.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.
-
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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.