Windows Develop Bookmark and Share   
 index > Windows Forms General > TabControl
 

TabControl

Hi All,

Here is my problem.......

I have a tab control with two tabpages , let's say that tabp1 and tabp2.
Under tabp1 i have some controls e.g: button and textbox..
There is a property called Enabled=true/false is there for the tab pages tabp1 and tabp2.
Let's say that i have set the Enabled property of tabp1 to false and tabp2 to true.

For the above requirement tabp1 tab should disable along with the controls and tabp2 tab should enable along with controls in tabp2 , but tabp1 tabis disabling but controls are not .


Coul anybody help me out?

Regards
Suresh

bikkisuresh  Thursday, October 01, 2009 2:50 PM
It's not really a designer issue and this question should be in a WinForms group (assuming it's a winforms app), but...

What language are you using?
Is this a standard System.Windows.Forms.TabControl?

From VS2005 on TabPage.Enabled property has been hidden but is still usable if you code it. If you Disable a tabpage then the tab will not disable but the controls contained within it will.
Mick Doherty
http://dotnetrix.co.uk
Mick Doherty  Thursday, October 01, 2009 5:44 PM
Hi Rohini,

This is a document shows how to disable a tab page:
http://msdn.microsoft.com/en-us/library/252t3cec.aspx
This is a thread:
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/662aa935-a10f-4721-a346-4ecbf0772d18

Regards,
Aland Li
Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
Aland Li  Wednesday, October 07, 2009 2:53 AM
It's not really a designer issue and this question should be in a WinForms group (assuming it's a winforms app), but...

What language are you using?
Is this a standard System.Windows.Forms.TabControl?

From VS2005 on TabPage.Enabled property has been hidden but is still usable if you code it. If you Disable a tabpage then the tab will not disable but the controls contained within it will.
Mick Doherty
http://dotnetrix.co.uk
Mick Doherty  Thursday, October 01, 2009 5:44 PM
I guess there is no alternative except to code it.

eg.,

Private Sub TabPage1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabPage1.Click

        Button1.Enabled = False

    End Sub
It would be really appreciated, if any one suggest other options.
Rohini Chavakula  Monday, October 05, 2009 2:07 PM
Hi Rohini,

This is a document shows how to disable a tab page:
http://msdn.microsoft.com/en-us/library/252t3cec.aspx
This is a thread:
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/662aa935-a10f-4721-a346-4ecbf0772d18

Regards,
Aland Li
Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
Aland Li  Wednesday, October 07, 2009 2:53 AM

You can use google to search for other answers

Custom Search

More Threads

• Testing for auto-size doing the right thing
• Defining an Array of Collections
• Multi Form Windows Application
• WebBrowser form/method/name help
• windows application without userinterface
• Treeview Tutorial
• How to capture lose focus event and reset focus
• how to make a starting windows disappear on a windows app
• Advanced thread synchronization issues ...
• How to catch selection of the text in WebBrowser?