首页 > 学院 > 开发设计 > 正文

VS2015 tabcontrol 横向排列

2019-11-08 21:00:09
字体:
来源:转载
供稿:网友

form load 写入代码

 PRivate void InitTabControl()

        {            tabControl1.Alignment = System.Windows.Forms.TabAlignment.Left;            tabControl1.DrawMode = TabDrawMode.OwnerDrawFixed;            tabControl1.ItemSize = new Size(60, 100);            tabControl1.SizeMode = TabSizeMode.Fixed;

        }

tabcontrol

 private void tabControl1_DrawItem(object sender, DrawItemEventArgs e)        {            string text = ((TabControl)sender).TabPages[e.Index].Text;            SolidBrush brush = new SolidBrush(Color.Black);            StringFormat sf = new StringFormat(StringFormatFlags.DirectionRightToLeft);            sf.LineAlignment = StringAlignment.Center;            sf.Alignment = StringAlignment.Center;            e.Graphics.DrawString(text, SystemInformation.MenuFont, brush, e.Bounds, sf);        }


上一篇:mysql collation

下一篇:GreenDao3.0简单使用

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表