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 );}}}}}}