简体   繁体   English

如何使ToolStripDropDownButton项字体粗体?

[英]How to make ToolStripDropDownButton items font bold?

I'm trying to format ToolStripDropDownButton items 我正在尝试格式化ToolStripDropDownButton项目

btn1.DropDown.ForeColor = Color.Gray; //this works
btn1.DropDown.Font.Bold = true; //this doesn't work.

Please, help. 请帮忙。

The problem is that the properties inside the Font are read-only. 问题是Font内的属性是只读的。 The solution is to create a new font, like this: 解决方案是创建一个新字体,如下所示:

btn1.DropDown.Font = new Font(btn1.DropDown.Font, FontStyle.Bold);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM