What version of the framework are you targeting?
What version of the framework are you targeting?
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.
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...
I'm guessing thatCode:
'##### 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)
is not doing what I expect it to, so has anyone got any tips that might get it to work? Thanks in advance!Code:PupilDetailsTab.Controls.Add(PupilDetailControlForm)
This is using VS 2005.
Your "cool skin" is amazing! Since JuggaloBrotha doesn't like my TabControl's default colors, I think I'll switch to that.
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! :)
cool man...thanks for sharing..
can i use it to my projects ? i'll credits ur name " ForumAccount from Vbforums "... hiahiahiah
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:
Hello, this sounds as a great control.
Is this fully compatible with VS2010 if we change the framework to 3.5?
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:
and 2 of these:Code:Type "DesignerActionUIService" is not defined
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??
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.
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 :)
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?
No, the reference does not appear in .NET 3.5 either.
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
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.
In the OnDrawTabContent method change this part (510-512):
To: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))
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.
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.
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