网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 时尚美容

C#窗体设计:[21]更改提示框字体

时间:2024-10-13 23:09:39

1、新建一个C#应用程序,应用程序命名为Change。

C#窗体设计:[21]更改提示框字体

3、为ToolTip控件添加Draw事件,添加函数toolTip1_Draw(),函数toolTip1_Draw()中添加一下代码:private void tool皈其拄攥Tip1_Draw(object sender, DrawToolTipEventArgs e) { e.Graphics.FillRectangle(SystemBrushes.ActiveCaption, e.Bounds); e.DrawBorder(); using (StringFormat sf = new StringFormat()) { sf.Alignment = StringAlignment.Center; sf.LineAlignment = StringAlignment.Center; using (Font f = new Font("宋体", 8)) { e.Graphics.DrawString(e.ToolTipText, f, SystemBrushes.ActiveCaptionText, e.Bounds, sf); } } }

C#窗体设计:[21]更改提示框字体

5、程序运行如下:

C#窗体设计:[21]更改提示框字体
© 2025 小知经验
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com