C # tabcontrol hides the index tag. The code is a ready-made component.

Source: Internet
Author: User
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 );}}}}}}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.