Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. Public Class Latihan9
  2. Private Sub Latihan9_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  3. Dim halaman As Byte
  4. halaman = 1
  5. Do While halaman <= 10
  6. ComboBox1.Items.Add(halaman)
  7. halaman = halaman + 1
  8. Loop
  9. End Sub
  10. Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
  11. Dim halaman As Byte
  12. halaman = 1
  13. Do While halaman <= 10
  14. ComboBox2.Items.Add(halaman)
  15. halaman = halaman + 1
  16. Loop
  17. End Sub
  18.  
  19. Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
  20. Dim hasil As Double = 1
  21. For i = 1 To Val(ComboBox2.Text)
  22. hasil = hasil * ComboBox1.Text
  23. Next
  24. TextBox1.Text = hasil
  25. End Sub
  26.  
  27. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  28. Dim result As Integer = MsgBox("Apakah Anda Sudah Yakin Mau Keluar? ", MsgBoxStyle.Information + MsgBoxStyle.OkCancel, "Informasi")
  29. If result = DialogResult.OK Then
  30. Me.Close()
  31. Else
  32. End If
  33. End Sub
  34. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement