C#中winform窗体 用代码设置字体的样式

protected override void OnPaint(PaintEventArgs e)
{
    FontFamily myFontFamily = new FontFamily("微软雅黑"); //采用哪种字体     
base.OnPaint(e);     this.ForeColor = Color.Red; //将label的颜色设为红色(可以设置成你想要的颜色)

    this.Font = new Font(myFontFamily, UIFontColor.FontSize, FontStyle

.Italic);

}

 

posted @ 2023-04-21 17:59  qingjiawen  阅读(887)  评论(0编辑  收藏  举报