禁用除选项卡控件C#中的当前选项卡以外的其他选项卡 [英] Disable other tabs except current tab in tab control C#
问题描述
亲爱的朋友,
我在Tab控件中有一个项目.
我在该标签控件中有三个标签,分别为(First_Tab,Second_Tab,Third_Tab).以同样的形式,我有三个名为(First_Button,Second_Button,Third_Button)的按钮.
我需要,当我单击First_Button时,--->从选项卡控件"中,"First_Tab"将启用,其他"外观为禁用"格式,用户无法在"First_Tab"以外的其他选项卡(2,3个选项卡)中进行任何更改.
当我单击Second_Button时,--->从选项卡控件"中,Second_Tab将启用,其他外观为禁用"格式,用户无法在Second_Tab之外的其他选项卡(1,3个选项卡)中进行任何更改.
当我单击Third_Button时,--->在选项卡控件"中,"Third"将启用,而其他显示为禁用"格式的用户将无法在"Third_Tab"以外的其他选项卡(1,2个选项卡)中进行任何更改.
请给我一些想法.........
[edit]已删除呼喊"-OriginalGriff [/edit]
Dear friends,
I have a project in Tab control.
I have three tabs in that Tab Control named (First_Tab, Second_Tab, Third_Tab). In that same form i have three Buttons named (First_Button, Second_Button, Third_Button).
I need, When i click the First_Button, ---> From the Tab Control, First_Tab will Enable and others looks Disable format user can''t do any change in other tabs (2,3 tabs) except First_Tab.
When i click the Second_Button, ---> From the Tab Control, Second_Tab will Enable and others looks Disable format user can''t do any change in other tabs (1,3 tabs) except Second_Tab.
When i click the Third_Button, ---> From the Tab Control, Third will Enable and others looks Disable format user can''t do any change in other tabs (1,2 tabs) except Third_Tab.
Please give some ideas.........
[edit]SHOUTING removed - OriginalGriff[/edit]
推荐答案
您无法禁用标签页.要阻止用户选择选项卡,唯一可以做的就是从控件中删除TabPage并在其有效时对其进行读取.
You can''t disable tabs. The only thing you can do to stop a user from selecting a tab is to remove the TabPage from the control and readd it when it''s valid to do so.
这篇关于禁用除选项卡控件C#中的当前选项卡以外的其他选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!