>我正在尝试格式化 ToolStripDropDownButton 项
btn1.DropDown.ForeColor = Color.Gray; //this works
btn1.DropDown.Font.Bold = true; //this doesn't work.
请帮忙。
问题是字体中的属性是只读的。解决方案是创建一个新字体,如下所示:
btn1.DropDown.Font = new Font(btn1.DropDown.Font, FontStyle.Bold);