更改组框的文本颜色? [英] Change group box text color?

查看:116
本文介绍了更改组框的文本颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何改变在C#中的一组框的文本颜色? 文档甚至没有提到这一点,谷歌搜索并没有止跌回升的答案。

How do you change the text color of a group box in C#? The "documentation" doesn't even mention this, and Googling hasn't turned up an answer.

谢谢!
阿伦

Thanks! Alan

推荐答案

使用的 前景色 财产。示例代码:

Use the ForeColor property. Sample code:

using System;
using System.Drawing;
using System.Windows.Forms;

class Test
{       
    [STAThread]
    static void Main(string[] args)
    {
        Form form = new Form();
        GroupBox group = new GroupBox();
        group.Text = "Text";
        group.ForeColor = Color.Red;
        form.Controls.Add(group);
        Application.Run(form);
    }
}

这篇关于更改组框的文本颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆