*ketika button ninja 250r di-klik
*ketika button ninja zx-6r di-klik
*ketika button zx-10r di-klik
*ketika button zx-14r di-klik
Gambar akan muncul secara otomatis ketika kita meng-klik button sesuai pilihan,lalu gambar akan menghilang ketika kita meng-klik button lain dengan menggunakan fungsi if,bisa diliha pada codding dibawah.
Apa yang terjadi apabila kita meng-klik button "Purchase" ?
akan muncul message box,untuk meminta konfirmasi dari anda. Lalu apa yang terjadi apabila kita meng-klik "Yes" ?
akan muncul message box lagi yang bertuliskan "Thank You for Purchasing" , dan ini pun menggunakan fungsi "IF"
berikut adalah codding dari program diatas:
"
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PictureBox3.Visible = False
PictureBox4.Visible = False
PictureBox5.Visible = False
PictureBox2.Visible = True
TextBox1.Text = "5111"
TextBox2.Text = TextBox1.Text * 9200
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
PictureBox2.Visible = False
PictureBox4.Visible = False
PictureBox5.Visible = False
PictureBox3.Visible = True
TextBox1.Text = "10500"
TextBox2.Text = TextBox1.Text * 9200
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
PictureBox2.Visible = False
PictureBox3.Visible = False
PictureBox5.Visible = False
PictureBox4.Visible = True
TextBox1.Text = "13000"
TextBox2.Text = TextBox1.Text * 9200
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
PictureBox2.Visible = False
PictureBox3.Visible = False
PictureBox4.Visible = False
PictureBox5.Visible = True
TextBox1.Text = "13400"
TextBox2.Text = TextBox1.Text * 9200
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Dim x As Integer
x = MessageBox.Show("Are You Sure to Exit?", "Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If (x = vbYes) Then
End
End If
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Dim y As Integer
y = MessageBox.Show("Are Sure to Purchase This Product?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If (y = vbYes) Then
MessageBox.Show("Thank for Purchasing Our Product", "Purchase", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
End Class
"
0 komentar:
Posting Komentar