111,129
社区成员
发帖
与我相关
我的任务
分享
this.tabControl1.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed;
this.tabControl1.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.tabControl1_DrawItem);
private void tabControl1_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
{
RectangleF tabTextArea = (RectangleF)tabControl1.GetTabRect(0);
Font font = new Font("宋体 ", 9F);
if (tabControl1.SelectedTab == tabControl1.TabPages[0])
font = new Font("宋体 ", 9F, FontStyle.Bold);
StringFormat drawFormat = new StringFormat();
drawFormat.Alignment = StringAlignment.Center;
drawFormat.LineAlignment = StringAlignment.Center;
SolidBrush brush = new SolidBrush(Color.Black);
e.Graphics.DrawString("自己画", font, brush, tabTextArea, drawFormat);
}