【问题标题】:How to replace Groupbox Text property with a Radio Button?如何用单选按钮替换 Groupbox Text 属性?
【发布时间】:2021-12-05 20:26:31
【问题描述】:

我一直在尝试编辑 GroupBox 类,但默认的 Text 属性返回 String 并且 RadioButton 是对象。我无法弄清楚缺少什么。

重要 我想要做的是更改 GroupBox1 的文本,而不是放置一个单选按钮以允许我启用表单。我不想在 groupBox 中放置多个单选按钮。

我也可以用 HTML 简单地做到这一点:

<form>
<fieldset>
    <legend>
        <input type="radio">
        <label>RadioButton1<label>
    </legend>
</fieldset>

出于好奇,它会呈现这种形式: enter image description here

我最近在修复一些网络问题时也看到了类似的表格,在 IPV4 下的 WLAN 属性中,它询问 DNS。这是表格的预览。 enter image description here

【问题讨论】:

    标签: c# visual-studio winforms radio-button


    【解决方案1】:

    这通常通过在GroupBox 控件之上覆盖RadioButton 来完成。您可能希望将组框的标签设置为空格序列,以便正确绘制其边框。

    【讨论】:

    • 是的,我可以做到。希望我能尽快弄清楚该怎么做。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-26
    • 1970-01-01
    • 1970-01-01
    • 2011-07-04
    • 2011-04-27
    相关资源
    最近更新 更多