Here it is a procedure in vb6 and it is working fine like the example included:
' Check_UnCheck
' check an array of some checkboxes, uncheck an array of another checkboxes
' Example of usage :
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
what is the equivalent in vb.net for the above procedure, the MSDN Documentation says :
- We cannot use more than one parameter array in a procedure, and it must be the last argument in the procedure definition.
Try below code.
Look into comments for detailed description.