I'm having a problem at my code. The for each command...
Private Sub cmdVoidOrder_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdVoidOrder.Click
Dim ctrl As Control
For Each ctrl In grpOderDetails.Controls
If TypeOf ctrl Is CheckBox Then
If ctrl.checked = True Then
'Syntax to void order
End If
End If
Next
End Sub
In VB 6.0 it does not have any error but when i Used it in .Net it has an error:
Error 1 'checked' is not a member of 'System.Windows.Forms.Control'.
any suggestions?
Because there's no control array in .Net I would like to validate the checkboxes using For Each command.
If a checkbox is checked then I would Void the order... its just a basic Sales Order system...
heres the sample image...
Private Sub cmdVoidOrder_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdVoidOrder.Click
Dim ctrl As Control
For Each ctrl In grpOderDetails.Controls
If TypeOf ctrl Is CheckBox Then
If ctrl.checked = True Then
'Syntax to void order
End If
End If
Next
End Sub
In VB 6.0 it does not have any error but when i Used it in .Net it has an error:
Error 1 'checked' is not a member of 'System.Windows.Forms.Control'.
any suggestions?
Because there's no control array in .Net I would like to validate the checkboxes using For Each command.
If a checkbox is checked then I would Void the order... its just a basic Sales Order system...
heres the sample image...
