Public Class Form1
Private Function AllEnabled(ByVal b As Boolean) As Boolean
For i As Integer = 0 To 2
Dim c As CheckBox = CType(Me.Controls("CheckBox" & i.ToString), CheckBox)
c.Enabled = b
Next
End Function
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Call AllEnabled(False)
End Sub
End Class
getting error with highlight in b at c.Enabled = b
(Object reference not set to an instance of an object.)
but when i use checkbox1.enabled = b instead of c.enabled = b works fine.
so as i see the wrong not with b right ?
& how can i fix this ?