private void tl_road_aagcgl_add_Load(object sender, EventArgs e)
{
tabControl1.DrawMode = TabDrawMode.OwnerDrawFixed;
tabControl1.Alignment = TabAlignment.Left;
tabControl1.SizeMode = TabSizeMode.Fixed;
tabControl1.Multiline = true;
tabControl1.ItemSize = new Size(30, 50);
tabControl1.DrawItem += tabControl1_DrawItem;
}
文章来源:https://www.toymoban.com/news/detail-759437.html
//调整选项卡文字方向
private void tabControl1_DrawItem(object sender, DrawItemEventArgs e)
{
SolidBrush _Brush = new SolidBrush(Color.Black);//单色画刷
RectangleF _TabTextArea = (RectangleF)tabControl1.GetTabRect(e.Index);//绘制区域
StringFormat _sf = new StringFormat();//封装文本布局格式信息
_sf.LineAlignment = StringAlignment.Center;
_sf.Alignment = StringAlignment.Center;
e.Graphics.DrawString(tabControl1.Controls[e.Index].Text, SystemInformation.MenuFont, _Brush, _TabTextArea, _sf);
}
文章来源地址https://www.toymoban.com/news/detail-759437.html
到了这里,关于c#tabcontrol怎么让tabpage在左边显示横向文字的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!