怎样让tabControl标签激活时的标签字体加粗

qhwahaha 2010-11-12 10:28:13
怎样让tabControl标签激活时所激活的标签字体加粗!
...全文
332 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
colorall 2010-11-16
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 qhwahaha 的回复:]
我通过事件改变了字体。。
但是整个标签里的字体都改了。。。
什么属性能只改标签的字体 而不改标签下面的内容的字体吗?
[/Quote]2楼的我试过是可以的,字体属性是不可以的。
qhwahaha 2010-11-16
  • 打赏
  • 举报
回复
我通过事件改变了字体。。
但是整个标签里的字体都改了。。。
什么属性能只改标签的字体 而不改标签下面的内容的字体吗?
qhwahaha 2010-11-16
  • 打赏
  • 举报
回复
要怎样实现效果
qhwahaha 2010-11-15
  • 打赏
  • 举报
回复
可以在上面绘制一个关闭的按钮来关闭标签吗?
colorall 2010-11-15
  • 打赏
  • 举报
回复
是重绘
qhwahaha 2010-11-15
  • 打赏
  • 举报
回复
重绘?
colorall 2010-11-13
  • 打赏
  • 举报
回复
设定自己画模式,


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);
}
quifar123 2010-11-12
  • 打赏
  • 举报
回复
试试改font 的size ???

111,129

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧