Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Latihan9
- Private Sub Latihan9_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Dim halaman As Byte
- halaman = 1
- Do While halaman <= 10
- ComboBox1.Items.Add(halaman)
- halaman = halaman + 1
- Loop
- End Sub
- Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
- Dim halaman As Byte
- halaman = 1
- Do While halaman <= 10
- ComboBox2.Items.Add(halaman)
- halaman = halaman + 1
- Loop
- End Sub
- Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
- Dim hasil As Double = 1
- For i = 1 To Val(ComboBox2.Text)
- hasil = hasil * ComboBox1.Text
- Next
- TextBox1.Text = hasil
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim result As Integer = MsgBox("Apakah Anda Sudah Yakin Mau Keluar? ", MsgBoxStyle.Information + MsgBoxStyle.OkCancel, "Informasi")
- If result = DialogResult.OK Then
- Me.Close()
- Else
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement