Table of contents
TOC
折叠目录
展开目录

GroupName 属性示例GroupName Property Example

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

下面的示例使用该体以创建两个组的同一窗体上的选项按钮控件。The following example uses the GroupName property to create two groups of OptionButton controls on the same form.

要使用本示例,请将复制到窗体的声明变量部分的此示例代码。请确保该窗体包含名为 OptionButton1 至 OptionButton5 的五个数值调节钮控件。To use this example, copy this sample code to the Declarations portion of a form. Make sure that the form contains five OptionButton controls named OptionButton1 through OptionButton5.

Private Sub UserForm_Initialize() 
 OptionButton1.GroupName = "Widgets" 
 OptionButton2.GroupName = "Widgets" 
 OptionButton4.GroupName = "Widgets" 

 OptionButton3.GroupName = "Gadgets-Group2" 
 OptionButton5.GroupName = "Gadgets-Group2" 
End Sub
© 2018 Microsoft