Click here to Skip to main content
15,920,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is there any way to disable other tabpages if current one is selected??? I know tabcontrol does not support enabled property.
Posted
Updated 11-Dec-13 19:09pm
v2
Comments
BillWoodruff 12-Dec-13 2:45am    
1. are you using the standard MS Win Forms TabControl ?

2. when you say "disable," do you mean disable navigation to another TabPage, or, do you mean that if the user navigates to another TabPage, then all Controls on that TabPage are disabled ?

3. do you wish to have this "disable" feature on only one TabPage; or, on some, but not all, TabPages; or, on all TabPages ?

4 is it important to you that this "disable" feature be triggered by an actual Control on a specifc TabPage, or TabPages ?

1. TabControl.Selection event:- handle this event & in this event use
e.Cancel = true
it prevents selection of tab page.

2. You can use
tabControl1.TabPages.RemoveByKey("TabPage1");

in form_load to remove tabpages.
 
Share this answer
 
Use TabControl.Selecting event to prevent user from changing selected tabpage
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900