C#窗体设计:[21]更改提示框字体
1、新建一个C#应用程序,应用程序命名为Change。
![C#窗体设计:[21]更改提示框字体](https://exp-picture.cdn.bcebos.com/50189b40102a04e20ae624f62b7aa010bd33c29b.jpg)
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]更改提示框字体](https://exp-picture.cdn.bcebos.com/efb861bd4c7c34b37b052d0e5841037de0373198.jpg)
5、程序运行如下:
![C#窗体设计:[21]更改提示框字体](https://exp-picture.cdn.bcebos.com/d4071b96b814f4d0e047d666cdfe474ec3832398.jpg)
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:21
阅读量:60
阅读量:75
阅读量:68
阅读量:30