zoukankan      html  css  js  c++  java
  • C# TabControl中Tab放於左邊並正常顯示TabText(


            /// <summary>
            
    /// 構造函數
            
    /// </summary>
            public TabL()
            {
                InitializeComponent();
                TabSet();
                tabLeft.DrawItem 
    += new DrawItemEventHandler(tabLeft_DrawItem);
            }

            
    /// <summary>
            
    /// 設定控件繪製模式
            
    /// </summary>
            private void TabSet()
            {
                tabLeft.DrawMode 
    = TabDrawMode.OwnerDrawFixed;
                tabLeft.Alignment 
    = TabAlignment.Left;
            }
            
    /// <summary>
            
    /// 重繪控件
            
    /// </summary>
            
    /// <param name="sender"></param>
            
    /// <param name="e"></param>
            void tabLeft_DrawItem(object sender, DrawItemEventArgs e)
            {
                StringFormat sfForamt 
    = new StringFormat();
                sfForamt.LineAlignment 
    = StringAlignment.Center;
                sfForamt.Alignment 
    = StringAlignment.Center;
                
    //sfForamt.FormatFlags = StringFormatFlags.DirectionVertical;
                TabControl tcTab = (TabControl)sender;
                e.Graphics.DrawString(tcTab.TabPages[e.Index].Text, SystemInformation.MenuFont, 
    new SolidBrush(Color.Black), e.Bounds, sfForamt);

            }

  • 相关阅读:
    【FastJSON序列化】FastJSON序列化
    【EsayExcel】EsayExcel生成自定义表头
    时间序列的基础频率
    问题记录 --> 未定义的引用 ||| not found
    linux shell find 用法大全
    pgrep -f abc匹配出含abc的进程 ||||||| pid pkill -f abc
    >/dev/null 2>&1
    编译,发版,链接库问题
    shell 问题 source project_env.sh
    linux/ubuntu 压缩与解压
  • 原文地址:https://www.cnblogs.com/scottckt/p/1009435.html
Copyright © 2011-2022 走看看