Checkbox
CheckBox 컨트롤은 Visual Basic .NET(VB.NET)에서 사용하는 체크 박스 유형의 컨트롤입니다. 이 컨트롤은 사용자가 특정 옵션을 선택하거나 취소할 수 있도록 합니다.
Source code
Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click CheckBox1.Checked = True End Sub Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click CheckBox2.Checked = True End Sub Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click CheckBox3.Checked = True End Sub Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click For Each myControl As Control In Me.Controls If TypeOf myControl Is GroupBox Then For Each Ctl1 As Control In myControl.Controls If TypeOf Ctl1 Is CheckBox Then Dim myCheckBox As CheckBox = Ctl1 myCheckBox.Checked = True End If Next End If Next End Sub End Class |