GroupName 属性示例

下例用 GroupName 属性在同一窗体上生成两组选项按钮控件。

窗体包含:

  • 名为 OptionButton1 到 OptionButton5 的五个选项按钮控件。
Sub UserForm_Initialize()
    UserForm_OptionButton1.GroupName = "Widgets"
    UserForm_OptionButton2.GroupName = "Widgets"
    UserForm_OptionButton4.GroupName = "Widgets"

    UserForm_OptionButton3.GroupName = "Gadgets-Group2"
    UserForm_OptionButton5.GroupName = "Gadgets-Group2"
End Sub

1
2
3
4
5
6
7
8
9