c# tabcontrol 隐藏索引标签,代码是现成的组件
2008-01-03 14:26
633 查看
using System.ComponentModel; using System.Drawing; using System.Windows.Forms; namespace Dotnetrix.Samples.CSharp { [ToolboxBitmap(typeof(System.Windows.Forms.TabControl))] public class TabControl : System.Windows.Forms.TabControl { private bool m_HideTabs = false; [DefaultValue(false)] [RefreshProperties(RefreshProperties.All)] public bool HideTabs { get{return m_HideTabs;} set { if (m_HideTabs == value) return; m_HideTabs = value; if (value == true) this.Multiline = true; this.UpdateStyles(); } } [RefreshProperties(RefreshProperties.All)] public new bool Multiline { get { if (this.HideTabs) return true; return base.Multiline; } set { if (this.HideTabs) base.Multiline = true; else base.Multiline = value; } } public override System.Drawing.Rectangle DisplayRectangle { get { if (this.HideTabs) return new Rectangle(0, 0, Width, Height); else { int tabStripHeight, itemHeight; if (this.Alignment <= TabAlignment.Bottom) itemHeight = this.ItemSize.Height; else itemHeight = this.ItemSize.Width; if (this.Appearance == TabAppearance.Normal) tabStripHeight = 5 + (itemHeight * this.RowCount); else tabStripHeight = (3 + itemHeight) * this.RowCount; switch (this.Alignment) { case TabAlignment.Bottom: return new Rectangle(4, 4, Width - 8, Height - tabStripHeight - 4); case TabAlignment.Left: return new Rectangle(tabStripHeight, 4, Width - tabStripHeight - 4, Height - 8); case TabAlignment.Right: return new Rectangle(4, 4, Width - tabStripHeight - 4, Height - 8); default: return new Rectangle(4, tabStripHeight, Width - 8, Height - tabStripHeight - 4); } } } } } }
相关文章推荐
- c# 如何隐藏TabControl控件的标签
- c# winform 隐藏tabcontrol标签
- C# tabcontrol组件(无标签页)
- c# TabControl 标签的隐藏
- c# 如何隐藏TabControl控件的标签
- C# TabControl标签的隐藏
- C# TabControl 隐藏标签头(TabControl Hide Head)
- 【转载】c# tabcontrol控件标签如何隐藏?
- C# inform自带TabControl控件隐藏标签方法
- c# tabcontrol控件标签如何隐藏?
- C#隐藏Tabcontrol标签
- C# 隐藏TabControl标签
- 如何隐藏TabControl中TabPage的页标签?
- C#重绘TabControl的Tabpage标签,添加图片及关闭按钮
- .NET : 隐藏TabControl的标签栏
- C#.NET常见问题(FAQ)-TabControl如何隐藏和显示页面
- C#中的TabControl控件的选项卡如何隐藏?
- 【WPF收藏】隐藏TabControl标签(按钮)的方法(Hide the TabStrip of a TabControl)
- 如何隐藏TabControl控件的标签
- .NET : 隐藏TabControl的标签栏