CheckBox berguna saat user perlu melakukan pilihan dan dapat memilih lebih dari 1 pilihan.
Contoh penggunaan checkbox.
Code:
Private Sub btnSubmit_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnSubmit.Click
Dim sPsn As String = ""
If CheckBox1.Checked = True Then sPsn += CheckBox1.Text & vbCrLf
If CheckBox2.Checked = True Then sPsn += CheckBox2.Text & vbCrLf
If CheckBox3.Checked = True Then sPsn += CheckBox3.Text & vbCrLf
If CheckBox4.Checked = True Then sPsn += CheckBox4.Text & vbCrLf
If CheckBox5.Checked = True Then sPsn += CheckBox5.Text & vbCrLf
If CheckBox6.Checked = True Then sPsn += CheckBox6.Text & vbCrLf
If CheckBox7.Checked = True Then sPsn += CheckBox7.Text & vbCrLf
If CheckBox8.Checked = True Then sPsn += CheckBox8.Text & vbCrLf
If CheckBox9.Checked = True Then sPsn += CheckBox9.Text & vbCrLf
If CheckBox10.Checked = True Then sPsn += CheckBox10.Text & vbCrLf
MsgBox("Anda Memesan: " & vbCrLf & sPsn, , "Pesanan")
End Sub
Runtime:
Tentang CheckBox Control:
CheckBox Properties
CheckBox Events
Contoh Project:
CheckBox Control Sample Project
Click here if you like this article.
Artikel Terkait:
Common Control Visual Basic .NET
Tutorial Visual Basic .NET
0 Comments