如何隐藏TabControl标题 [英] How to Hide TabControl Headers

查看:91
本文介绍了如何隐藏TabControl标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在My Project中使用TabControl,我想只在整个标签中隐藏TabControl标题,



任何解决方案都在那里

i am Using TabControl in My Project, i want Hide TabControl Headers only not in Whole Tab,

any Solution is there

推荐答案

我找到解决方案



解决方案是



Maintab.Appearance = TabAppearance.FlatButtons; Maintab.ItemSize = new Size(0,1); Maintab.SizeMode = TabSizeMode.Fixed;
I Finded the Solutions

Solution is

Maintab.Appearance = TabAppearance.FlatButtons; Maintab.ItemSize = new Size(0, 1); Maintab.SizeMode = TabSizeMode.Fixed;


如果您使用的是Windows窗体,隐藏单个标签页的唯一方法是将其从Tabs控件的TabPages集合中删除。没有.Visible属性适用于标签页。如果你正在使用WPF,我认为有办法做到这一点,但我不知道你正在使用什么框架。
If you are using Windows Forms, the only way to hide a single tab page is to remove it from the TabPages collection of the Tabs control. There is no .Visible attribute that works on Tab Pages. If you are using WPF I think there are ways to do it, but I don't know what framework you are using.


C#



C#

private void TabItemControl_MouseEnter(object sender, MouseEventArgs e) {
 if (this.TabItemControl.IsSelected == false) { this.TabItemControl.Opacity = 100;}
}

private void TabItemControl_MouseLeave(object sender, MouseEventArgs e) {
 if (this.TabItemControl.IsSelected == false) { this.TabItemControl.Opacity = 0;}
}

private void TabAllControl_SelectionChanged(object sender, SelectionChangedEventArgs e) {
 if (this.TabItemControl.IsSelected == false) { this.TabItemControl.Opacity = 0;}
}


这篇关于如何隐藏TabControl标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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