/// <summary>
/// 绘制 Tab 页头
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void CodeCfgUI_DrawItem(object sender, DrawItemEventArgs e)
{
Font fntTab = _buttonFont;
Brush bshBack = new SolidBrush(_buttonColorBG);
Brush bshFore = new SolidBrush(_buttonColorFore);
//画样式
string tabName = this._CodeCfgUI.TabPages[e.Index].Text;
StringFormat sftTab = new StringFormat();
sftTab.Alignment = StringAlignment.Center; //水平方向居中
sftTab.LineAlignment = StringAlignment.Center; //垂直方向居中
e.Graphics.FillRectangle(bshBack, e.Bounds);
Rectangle recTab = e.Bounds;
recTab = new Rectangle(recTab.X, recTab.Y + 4, recTab.Width, recTab.Height - 4);
e.Graphics.DrawString(tabName, fntTab, bshFore, recTab, sftTab);
}