实现效果:
知识运用:
ToolStripMenuItem菜单项的Font属性 //设置菜单项文本内容的字体
public virtual Font Font {get;set; }
实现代码:
private void button1_Click(object sender, EventArgs e) { ToolStripMenuItem P_toolStripMenuItem = (ToolStripMenuItem)menuStrip1.Items[0]; foreach (ToolStripMenuItem P_item in P_toolStripMenuItem.DropDownItems) { P_item.Font = new Font(new Font("楷体",9),FontStyle.Bold); } }
原文地址:https://www.cnblogs.com/feiyucha/p/10167901.html
时间: 2024-11-09 02:44:55