制作一组单选按钮 [VB.NET]

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15323235/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 12:42:40  来源:igfitidea点击:

Make a group of Radio buttons [VB.NET]

vb.net

提问by user1970090

I have two groups of Radio buttons but they are put in one group box , so how can i separate them without creating another group box , so if i choose an option from group 1 i will still be able to choose option from group 2 ?

我有两组单选按钮,但它们被放在一个组框中,那么如何在不创建另一个组框的情况下将它们分开,所以如果我从组 1 中选择一个选项,我仍然可以从组 2 中选择选项?

回答by Sam

If you don't want to disrupt with group boxes, use Panels (System.Windows.Forms.Panel). You won't see the border but the radio buttons will work independently.

如果您不想破坏分组框,请使用 Panels (System.Windows.Forms.Panel)。您不会看到边框,但单选按钮将独立工作。

回答by Austin B

Radio buttons will act as though they are all in one group unless separated.

除非分开,否则单选按钮的作用就好像它们都在一组中一样。

You do that with Panelsor Group Boxes

你用面板分组框来做到这一点

The difference is Group Boxesare visible whereas Panelsare invisible.

区别在于Group Boxes是可见的,而Panels是不可见的。

Radio Buttons in Panel

面板中的单选按钮

^ Here, the lower 3 radio buttons are in a Panelto separate them from the upper 3 buttons.

^ 此处,下方的 3 个单选按钮位于面板中,以将它们与上方的 3 个按钮分开。