您的位置:首页 > 其它

tabcontrol不给力,标题不能改解决方法。直接上源码,不注释。

2011-04-19 13:27 211 查看
Rectangle tabArea1;
Rectangle tabArea2;
RectangleF tabTextArea1;
RectangleF tabTextArea2;
tabArea1 = tabControl1.GetTabRect(0);
tabArea2 = tabControl1.GetTabRect(1); ;
tabTextArea1 = (RectangleF)tabControl1.GetTabRect(0);
tabTextArea2 = (RectangleF)tabControl1.GetTabRect(1);
Graphics g = e.Graphics;
Pen p = new Pen(Color.Black);
Font font = new Font("宋体", 9.0f);
SolidBrush brush = new SolidBrush(Color.Silver);
e.Graphics.FillRectangle(brush, tabControl1.Bounds);

brush = new SolidBrush(Color.LightGray);
e.Graphics.FillRectangle(brush, e.Bounds);
brush = new SolidBrush(Color.WhiteSmoke);
g.FillRectangle(brush, tabTextArea1);

g.FillRectangle(brush, tabTextArea2);
brush = new SolidBrush(Color.Black);
StringFormat sf = new StringFormat();

sf.LineAlignment = StringAlignment.Center;
sf.Alignment = StringAlignment.Center;

g.DrawString(" 酒店管理 ", font, brush, tabTextArea1, sf);
g.DrawString("酒店区域管理", font, brush, tabTextArea2, sf);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: