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

            }

  • 相关阅读:
    AutoLayout动画
    实现毛玻璃效果
    合并静态库
    GCDAsyncSocket~
    iOS下URL编码
    OC多线程之GCD ----- 2
    堆和栈的区别
    Effective Objective-C 2.0重读笔记---2
    Android手机端抓包方法
    Android APK反编译
  • 原文地址:https://www.cnblogs.com/scottckt/p/1009435.html
Copyright © 2020-2023  润新知