form ini menampilkan option box. ketika kita memilih pada option box,maka teks pada text box akan menampilkan tulisan yang kita pilih seperti contoh diatas.
Public Class Form1
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Txt1.TextChanged
End Sub
Private Sub Rbt1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Rbt1.CheckedChanged
End Sub
Private Sub Rbt1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Rbt1.Click
Txt1.Text = Rbt1.Text
End Sub
Private Sub Rbt2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Rbt2.CheckedChanged
End Sub
Private Sub Rbt2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Rbt2.Click
Txt1.Text = Rbt2.Text
End Sub
Private Sub Rbt3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Rbt3.CheckedChanged
End Sub
Private Sub Rbt3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Rbt3.Click
Txt2.Text = Rbt3.Text
End Sub
Private Sub Rbt4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Rbt4.CheckedChanged
End Sub
Private Sub Rbt4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Rbt4.Click
Txt2.Text = Rbt4.Text
End Sub
Private Sub Rbt5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Rbt5.CheckedChanged
End Sub
Private Sub Rbt5_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Rbt5.Click
Txt2.Text = Rbt5.Text
End Sub
Private Sub Rbt6_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Rbt6.CheckedChanged
End Sub
Private Sub Rbt6_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Rbt6.Click
Txt2.Text = Rbt6.Text
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form2.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
End Class
form ini menampilkan tentang checkbox,pada contoh kali ini saya menampilkan jika kita men-check list pilihan maka akan muncul gambar seperti diatas.
kodenya adalah
Public Class Form2
Private Sub CheckBox5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox5.CheckedChanged
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Form1.Show()
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
If CheckBox1.Checked = True Then
PictureBox1.Visible = True
Else
CheckBox1.Checked = False
PictureBox1.Visible = False
End If
End Sub
Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged
If CheckBox2.Checked = True Then
PictureBox2.Visible = True
Else
CheckBox2.Checked = False
PictureBox2.Visible = False
End If
End Sub
Private Sub CheckBox3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.CheckedChanged
If CheckBox3.Checked = True Then
PictureBox3.Visible = True
Else
CheckBox3.Checked = False
PictureBox3.Visible = False
End If
End Sub
Private Sub CheckBox4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox4.CheckedChanged
If CheckBox4.Checked = True Then
PictureBox4.Visible = True
Else
CheckBox4.Checked = False
PictureBox4.Visible = False
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Form3.Show()
End Sub
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
End Sub
End Class
0 komentar:
Posting Komentar