Click to See Complete Forum and Search --> : TabControl
dubem
December 5th, 2002, 07:56 AM
Hello everyone
the Tabcontrol in .Net is not very adequate. I can't disable only one tab or I can't hide only one tab. Do you know a better tabControl?
Thank you
CC_
December 5th, 2002, 04:49 PM
This disable's a tab page, is that what you want?, it works for me.
'disable this page
Me.TabPage3.Enabled = False
EDIT:
I think i may have mis-read your post, you want to disable the tab itself, i think the above disable's any controls on the tabpage.
I'm not sure how to disable or hide a tab.
MoonNight
December 6th, 2002, 07:35 AM
I found this in VS help:
Use the Add method of the TabPages property.
' Visual Basic
Dim myTabPage As New TabPage()
myTabPage.Text = "TabPage" & (TabControl1.TabPages.Count + 2)
TabControl1.TabPages.Add(myTabPage)
Use the Remove method of the TabPages property to remove selected tabs; or to remove all tabs, use the Clear method of the TabPages property.
' Visual Basic
' Removes the selected tab:
TabControl1.TabPages.Remove(TabControl1.SelectedTab)
' Removes all the tabs:
TabControl1.TabPages.Clear()
dubem
December 6th, 2002, 09:13 AM
allright
but this will destroy the tab and all is controls. What I want is, I have two radio button, when radio button 1 is selected, the tab 3 isn't visible. If the radio button 2 is selected, the tab 3 is visible. The user can change the radio button selection so the tab must be hide and unhide and hide and unhide. If I remove the tab, I will remove all the controls. I don't want to create all the controls dynamicly each time
any solution?
Thank you
MoonNight
December 6th, 2002, 09:34 AM
http://msdn.microsoft.com/msdnmag/issues/02/06/basics/default.aspx
This article discusses a problem similar to yours. Maybe you can get some insight from it.
Hope it helps.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.