这是 vb6 中的一个过程,它工作正常,就像包含的示例一样:
' Check_UnCheck
' 选中一些复选框的数组,取消选中另一个复选框的数组
' 用法示例:
CheckBox.Check_UnCheck Array(chkCheck3, chkCheck5), Array(chkCheck1, chkCheck4)
Public Sub Check_UnCheck(ByRef CheckArray As Variant, ByRef UnCheckArray As Variant)
Dim i As Integer
Dim conControl As Control
For i = LBound(CheckArray) To UBound(CheckArray)
Set conControl = CheckArray(i)
conControl.Value = 1
Next
For i = LBound(UnCheckArray) To UBound(UnCheckArray)
Set conControl = UnCheckArray(i)
conControl.Value = 0
Next
End Sub
上述过程在 vb.net 中的等效项是什么,MSDN 文档说:
- 我们不能在一个过程中使用多个参数数组,它必须是过程定义中的最后一个参数。