 |
| 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
|
|
|
|

May 12th, 2006, 05:41 AM
|
|
Authorized User
|
|
Join Date: May 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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)
|
|

May 12th, 2006, 06:59 AM
|
|
Authorized User
|
|
Join Date: May 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

May 12th, 2006, 10:08 AM
|
|
Authorized User
|
|
Join Date: Apr 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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...
|
|

May 13th, 2006, 06:16 AM
|
|
Authorized User
|
|
Join Date: May 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
That was just the problem, like I said, the tabPage does not have an enable property.
|
|

May 13th, 2006, 08:11 AM
|
|
Authorized User
|
|
Join Date: Apr 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

May 15th, 2006, 03:15 AM
|
|
Authorized User
|
|
Join Date: May 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

May 15th, 2006, 05:21 AM
|
|
Authorized User
|
|
Join Date: Apr 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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...
|
|

May 15th, 2006, 05:55 AM
|
|
Authorized User
|
|
Join Date: May 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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 ^^.
|
|
 |