无法对属性或索引器“System.Drawing.Font.Bold”赋值 -- 它是只读的 解决方案

错误代码

ns.Appearance.TextAppearance.TextProperties.Font.Bold = true;

编译器错误消息: CS0200: 无法对属性或索引器“System.Drawing.Font.Bold”赋值 -- 它是只读的

解决方法:

        System.Drawing.Font fonta=new System.Drawing.Font("",20,System.Drawing.FontStyle.Bold);
        ns.Appearance.TextAppearance.TextProperties.Font = fonta;
posted @ 2020-01-10 14:43  惊风雨  阅读(1412)  评论(0)    收藏  举报