Wrox Programmer Forums
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 12th, 2006, 05:41 AM
Authorized User
 
Join Date: May 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to ColdFusion
Default tabControl

I've a big problem with tabControl.

There is no "enabled" property for pageControls in teh tabControl. The only thing I can do with the tabControl is adding a listener that after selectedindex change event sets the selected page back. Of some reason the old panel is still there however in the tabpage I set it back to be, very odd. It also loads the tabpage and then the selectedindex listener gets fired.

What I want is for some specific tabpages not to be clickable at all but visible in the tabcontrol.

Help would be very appreciated. (msdn solution to this does not work good at all)

 
Old May 12th, 2006, 06:59 AM
Authorized User
 
Join Date: May 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to ColdFusion
Default

EventArgs e

Settings e.Cancel=true; works fine in the listner when it's not to run, but I've implemented a listner that fires before selectedindexchange takes place. So hade to moddify mircrosoft tabControl to get it to work.

 
Old May 12th, 2006, 10:08 AM
Authorized User
 
Join Date: Apr 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

the TabPage as a property Enabled i think.... Did you checked this?

You'll need to get the TabPage you want to disable... I guess TabControl has a tabpage collection or something or a GetControl method...

 
Old May 13th, 2006, 06:16 AM
Authorized User
 
Join Date: May 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to ColdFusion
Default

That was just the problem, like I said, the tabPage does not have an enable property.

 
Old May 13th, 2006, 08:11 AM
Authorized User
 
Join Date: Apr 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

TabPage does have an enabled property but it does not do what you want... It sets all controls enabled property in that page to the selected value...

TabPage tp = tabControl1.TabPages[1];
tp.Enabled = false;

this is possible

 
Old May 15th, 2006, 03:15 AM
Authorized User
 
Join Date: May 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to ColdFusion
Default

I'm sitting in vs 2005 right now and I'm telling you, there is no tabPage.Enable property. All thou msdn claims it is there, but when I for a tabPage write '.' in the huge list there, there is no enabled property.

 
Old May 15th, 2006, 05:21 AM
Authorized User
 
Join Date: Apr 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I't doesn't shows because what they say is that the property is not intended to be used... but if you do in your code something like this:

TabPage tp = tabControl.TabPages[0];
tp.Enabled = false;

it works.... in VS2003 and VS2005... But like i said you can select the tab page same way.. only thing it changes is that all controls in that page becomes disabled...

 
Old May 15th, 2006, 05:55 AM
Authorized User
 
Join Date: May 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to ColdFusion
Default

Yeah well, cinda bad of microsoft to now have implemented something for what I wanted to do, and are now doing but not in the way it should be done, canceling the event ^^.






Similar Threads
Thread Thread Starter Forum Replies Last Post
tabcontrol issue/bug exavier C# 2005 1 June 21st, 2007 05:33 AM
Toolstrip and TabControl pamskate5 Visual Basic 2005 Basics 0 October 12th, 2006 04:35 PM
Problem with tabcontrol Slago VS.NET 2002/2003 2 July 2nd, 2006 07:11 PM
need help on tabcontrol Haydeé VB.NET 2002/2003 Basics 1 May 23rd, 2006 04:31 AM
Add a tabpage to a tabcontrol Mosquito109 VS.NET 2002/2003 0 August 18th, 2004 08:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.