VB.Net Check, Uncheck All CheckBoxes

How To Check Or UnCheck All CheckBox In The Form Using Visual Basic.Net

vbnet check & uncheck all checkboxes



In this VB.Net Tutorial we will see How To Select Or UnSelect All CheckBox Inside A Window Form Application On Button Click Event In Visual Basic.Net Programming Language And Visual Studio IDE .




Project Source Code:

Public Class Check_And_Uncheck_AllCheckBoxes

    Private Sub ButtonCheck_Click(sender As Object, e As EventArgs) Handles ButtonCheck.Click

        For Each c As Control In Controls

            If c.GetType() = GetType(CheckBox) Then

                Dim ch As CheckBox
                ch = c
                ch.Checked = True

            End If

        Next

    End Sub

    Private Sub ButtonUnCheck_Click(sender As Object, e As EventArgs) Handles ButtonUnCheck.Click

        For Each c As Control In Controls

            If c.GetType() = GetType(CheckBox) Then

                Dim ch As CheckBox
                ch = c
                ch.Checked = False

            End If

        Next

    End Sub
End Class
                                       

////// OUTPUT : 

check and uncheck checkboxes using vb.net



Share this

Related Posts

Previous
Next Post »