| | |
Tab Control in VB.Net
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2007
Posts: 9
Reputation:
Solved Threads: 0
Hi All,
I m working on a TabControl in Vb.Net. Its having 4 tabpages. like Tab1, Tab2, Tab3, Tab4. On Tab1 I m having a checkBox.
My requirement is when checkBox.Checked=True it will enable the Tab2. How can I go for this?
Note: I m not selecting the Tab2
Plz give me few sugestion
Thanks
I m working on a TabControl in Vb.Net. Its having 4 tabpages. like Tab1, Tab2, Tab3, Tab4. On Tab1 I m having a checkBox.
My requirement is when checkBox.Checked=True it will enable the Tab2. How can I go for this?
Note: I m not selecting the Tab2
Plz give me few sugestion
Thanks
M Patra
SSE
AISL, India
SSE
AISL, India
You can do it by using 2 methods first
TabControl.SelectedTab = TabPage
or
TabControl.SelectedIndex = theNumberOfTabSelected
TabControl.SelectedTab = TabPage
or
TabControl.SelectedIndex = theNumberOfTabSelected
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
So you want to have the second tab disabled until they check this checkbox?
Well, after fiddling around for a little bit (I'm rather new to Visual Basic so maybe this could be done better) I've found out that there is no 'obvious' enabled state of the tab. The intellisense doesn't pick it up and it's not in the properties panel but you can set it through using:
So make sure you set the Enabled State of the TabPage to False and then use that code, edit it to your hearts delight to enable the page. Maybe someone else knows how to disable the tab altogether
but here's my suggestion.
(My tabs are messed up in my code, so be aware.)
Well, after fiddling around for a little bit (I'm rather new to Visual Basic so maybe this could be done better) I've found out that there is no 'obvious' enabled state of the tab. The intellisense doesn't pick it up and it's not in the properties panel but you can set it through using:
TabPageName.Enabled = False set that when the form loads, the user can still click the tab but all the controls within that tab are disabled (I don't know how to disable the tab entirely sorry :/) VBNET Syntax (Toggle Plain Text)
Private Sub checkbox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles checkBox.CheckedChanged If checkBox.Checked = True Then TabPageName.Enabled = True ElseIf checkBox.Checked = False Then TabPageName.Enabled = False End If End Sub
So make sure you set the Enabled State of the TabPage to False and then use that code, edit it to your hearts delight to enable the page. Maybe someone else knows how to disable the tab altogether
but here's my suggestion.(My tabs are messed up in my code, so be aware.)
Stone In Focus - Caffeine Group - CoffeePHP - Open Notes - Onyx - Redpoint Network - Espresso
•
•
Join Date: Jun 2009
Posts: 11
Reputation:
Solved Threads: 0
Although you have mention a way to disable tab controls in vb.net that wasn't working
Don't know the reason
I'm using VB.Net 2005 it doesn't have enabled property for tabpages.
Therefore once you type as follows it will prompt an error message
TabPageName.Enabled=true
Enabled is not a property of TabPage
So if you find another way to disable tab pages please post it
Don't know the reason
I'm using VB.Net 2005 it doesn't have enabled property for tabpages.
Therefore once you type as follows it will prompt an error message
TabPageName.Enabled=true
Enabled is not a property of TabPage
So if you find another way to disable tab pages please post it
•
•
Join Date: Jun 2009
Posts: 11
Reputation:
Solved Threads: 0
you are specifying a way to select the tab when some control had been changed.But what i want to do is to disable the tab page when i change a control.
What I got to know is there is no way to disable a tab page in VB.Net
So i have tried inserting a panel in to the tab page and put all controls in to that panel. Thereby making the panel disabled when a control had been changed.
This way i got the thing i want to do.
Thanx for your support
What I got to know is there is no way to disable a tab page in VB.Net
So i have tried inserting a panel in to the tab page and put all controls in to that panel. Thereby making the panel disabled when a control had been changed.
This way i got the thing i want to do.
Thanx for your support
•
•
Join Date: Oct 2009
Posts: 1
Reputation:
Solved Threads: 0
kimbula,
I know this thread is a bit old but I wanted to propose another option. You could have the tab removed (made invisible) when the form loads, then add it back when the user checks the checkbox.
To remove the tab:
To add:
I know this thread is a bit old but I wanted to propose another option. You could have the tab removed (made invisible) when the form loads, then add it back when the user checks the checkbox.
To remove the tab:
VB.NET Syntax (Toggle Plain Text)
TabControl1.Controls.Remove(tab2)
To add:
VB.NET Syntax (Toggle Plain Text)
TabControl1.Controls.Add(tab2)
![]() |
Similar Threads
- ASP.NET button backcolor changing from code. (ASP.NET)
- tab control (ASP.NET)
- How to transfer values between ASP.NET pages (ASP.NET)
- How do I show Tab control on my form in Win XP style Look? (VB.NET)
- How to code "tab control' in the web form in ASP.NET / VB.NET ? (ASP.NET)
- what is tab in asp.net? (ASP.NET)
- Javascript:How to transfer values between ASP.NET pages (JavaScript / DHTML / AJAX)
Other Threads in the VB.NET Forum
- Previous Thread: code to clear all textboxes in a form
- Next Thread: Convert 1-Dim String Array to String
| Thread Tools | Search this Thread |
.net .net2008 2008 access account advanced application array basic beginner browser button buttons center click code combo cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic excel exists fade filter forms generatetags gridview html images input insert intel internet listview map mobile module monitor msaccess net number objects open panel passingparameters pdf picturebox picturebox2 port position print printing problem regex right-to-left save search searchvb.net select serial settings shutdown socket sqldatbase sqlserver survey table temperature textbox timer timespan transparency txttoxmlconverter update user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode xml year






