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.
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)
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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.
Currently using VS 2015 Enterprise on Win10 Enterprise x64.
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.
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
This is an awesome control.
But can you add a property for changing the heights of each Tab, in the next version ?
Thanks...
If my post was helpful to you, then express your gratitude using Rate this Post.
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video) My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet Social Group:VBForums - Developers from India
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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.
Last edited by NickThissen; Aug 17th, 2010 at 02:48 PM.
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)
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.
Last edited by raineym; Dec 2nd, 2010 at 09:46 PM.
Michael Rainey
--------------------
OS: Windows 11 Professional
VS: 2022
Level: Intermediate
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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)
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.
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.
Michael Rainey
--------------------
OS: Windows 11 Professional
VS: 2022
Level: Intermediate
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Originally Posted by 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.
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.
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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?
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Originally Posted by 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
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?
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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.
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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:
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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?
Last edited by eddie298; Jul 14th, 2011 at 06:12 PM.
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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.
Currently using VS 2015 Enterprise on Win10 Enterprise x64.
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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.
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Originally Posted by 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.
Like
If my post was helpful to you, then express your gratitude using Rate this Post.
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video) My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet Social Group:VBForums - Developers from India
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Originally Posted by 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.
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?
Currently using VS 2015 Enterprise on Win10 Enterprise x64.
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Originally Posted by JuggaloBrotha
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.
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
Originally Posted by ForumAccount
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.
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 coolcurrent4u
Hello, can this tab orientation be change to top or bottom?
No. I'll think about possibly doing that.
Originally Posted by JuggaloBrotha
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*
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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.
Re: [.NET 2.0+] Visual Studios "My Project" Tab Control (Updated! 12/9/2009)
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
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 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!