I am trying to check all the text boxes in a datagrid view with this
I am getting the error 'checked' is not a member of 'System.Windows.Forms.Control'. and it is underlining the ctl.checked in the second if statement. I am pretty sure my problem is with the Me.dgvPosiPay.Controls part of the code block but I am not sure what the correct syntax should be.VB Code:
Dim ctl As Control Dim cbx As CheckBox For Each ctl In Me.dgvPosiPay.Controls If ctl.GetType Is cbx.GetType Then ctl = DirectCast(ctl, CheckBox) If ctl.Checked = False Then ctl.checked = True End If End If Next




Reply With Quote