如何在c#中禁用选项卡控件中的必需选项卡 [英] How can u disable the required tabs in tab control in c#

查看:320
本文介绍了如何在c#中禁用选项卡控件中的必需选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

其实我开发了tab control win application.tab控件包含很多标签。



i想要根据应用程序禁用标签





i喜欢以下流程以及如何以这种方式禁用:





我的项目基于使用tab的逐步工作。例如,如果你有完整的



操作一个标签,然后转到下一个标签。





如果在一个标签上完成一项操作,那么请转到


时间上一个选项卡已禁用(用户无法看到该选项卡)此过程已完成,直到



操作在最后一个选项卡上完成。



请帮帮我。

Actually I have develop tab control win application.tab control contain many tabs.

i want to disable the tabs based on application


i Would liked to below process and how to disable in this follwing way:


my project working based on the step by step using tabs.for example if u have complete

the operation one tab after that go to the next tab.


if one operation is completed on one tab then go to the next tab at the

time previous tab disabled(user can't see the tab) this process is completed till

operation is completed on last tab.

please help me.

推荐答案

不幸的是TabControl不支持隐藏标签,如下所述 MSDN [< a href =https://msdn.microsoft.com/en-us/library/system.windows.forms.tabpage.aspx\"target =_ blank> ^ ],但是您有几个选项。



当用户点击next或ok按钮时,将TabControl选择的索引更改为下一个tabpages索引(即:
Unfortunately the TabControl doesn't support hiding the tabs as stated at MSDN[^], however you have a couple options.

When the user clicks next or ok button, change the TabControl selected index to the next tabpages index (i.e.:
if (tabControl1.SelectedIndex  <= tabControl1.TabPages.Count) {tabControl1.SelectedIndex += 1;}





现在为了隐藏前面的标签,你可以删除它们(虽然注意这会将所选标签移动到第一个位置







之后更改了lected选项卡,创建了一个用户控件或面板,Label可以正常工作。将背景颜色设置为tabControl1的背景颜色,并将矩形设置为选项卡的大小。



将控件的位置放在前一个的起始位置'隐藏'标签。根据需要进行调整。伪造隐藏标签的好方法。



Now for the 'hiding' of the previous tabs, you can either remove them (though note this would move the selected tab to the first position

OR

after the selected tab is changed, create a usercontrol or panel, event a Label would work. Set the back color to the background color of tabControl1, and set the Rectangle to the size of the tab.

Place the control's position at the starting point of the previous 'hidden' tab. Make adjustments as needed.. Nice way to 'fake' hide the tab.


这篇关于如何在c#中禁用选项卡控件中的必需选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆