跨不同面板的 VB.NET 组单选按钮 [英] VB.NET Group Radio Buttons across different Panels
问题描述
所以我在每个面板中以编程方式添加了 2 个面板和相同数量的单选按钮.例如
So I have 2 panels and the same number of radio buttons added programatically in each panel. For ex.
RB1 -> Panel1
RB2 -> Panel1
RBo1 -> Panel2
RBo2 -> Panel2
我想将 RB1 和 RBo1 以及 RB2 和 RBo2 分组,但是当我将单选按钮添加到不同的面板时,它们会相互分组.我尝试将 RB1 和 RBo2 添加到同一个 GroupBox,但也无法实现目标.有任何想法吗?是否可以手动链接单选按钮?
I want to group RB1 and RBo1 and RB2 and RBo2, but when I add the radio buttons to the different panels they group each other. I tried adding RB1 and RBo2 to the same GroupBox but could not achieve the goal either. Any ideas? Is it possible to manually link the radio buttons?
推荐答案
如果您绝对需要这种格式,您可以将每个 RadioButton
放在自己的 Panel
中;它们将被视为单独的组,然后您可以通过处理 Checked
事件手动链接它们.
If you absolutely must have this format, you can just place each RadioButton
within its own Panel
; they'll be treated as separate groups, and you can then link them manually by handling the Checked
event.
这篇关于跨不同面板的 VB.NET 组单选按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!