算了,我还是给你写个吧,看来你也够辛苦的了!!
第一步:设置Alignment=left
设置DrowMode=OwnerDrawFixed
设置ItemSize=30,100
设置SizeMode=Fixed
第二部:重绘,实现tabcontrol控件的tabControl1_DrawItem事件,如下所示
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);
}
效果如下