Windows窗体中没有组框的单选按钮的分组 [英] grouping of radio buttons without groupbox in windows forms

查看:80
本文介绍了Windows窗体中没有组框的单选按钮的分组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在创建Windows表单,并在同一表单上使用4个单选按钮.
而且我不想使用组框或面板.
看我的问题...

假设表单上有4个单选按钮.没有分组框或
面板将它们分开.默认情况下,这四个单选按钮是相互
独家的.是否可以将它们分为两组?

例如,
性别()rb1()rb2
婚姻状况()rb3()rb4

有人对此有任何想法吗?
在此先感谢

解决方案

无线电组不必分组为控件GroupBox的子级.您需要做的就是让他们成为孩子并且拥有相同的控件,无论是哪种类型.它们的父级可以是Panel的实例,也可以是从该类型派生的任何自定义控件.

—SA


当然,您可以选择两个Gender单选按钮并将GroupName属性设置为任何值"Gender",然后选择下两个单选按钮"并将GroupName属性设置为其他值

hi all,
i m creating a windows form and using 4 radio buttons on the same form.
and i dont want to use group box or panel.
see my prob...

Suppose there are 4 radion buttons on the form. There is no groupbox or
panel to seperate them. By default, the 4 radio buttons are mutually
exclusive. Is it possible to group them into two groups?

For example,
Gender ( )rb1 ( )rb2
Marital status ( )rb3 ( )rb4

anyone have any idea about it?
thanks in advance

解决方案

The radio groups do not have to be grouped as children of the control GroupBox. All you need is to make them children and the same control, no matter of what type. Their parent could be an instance of Panel or any custom control derived from this type.

—SA


Sure, you can select the two Gender Radio Buttons and set GroupName property to any value "Gender" for example and then select the Next two Radio Buttons and set the GroupName property to a different value


这篇关于Windows窗体中没有组框的单选按钮的分组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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