Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. Public Class Latihan3
  2. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  3. Dim x, y, i, hasil As Double
  4. x = Val(TextBox1.Text)
  5. y = Val(TextBox2.Text)
  6. hasil = 1
  7. For i = 1 To y
  8. hasil = hasil * x
  9. Next
  10. TextBox3.Text = Str(hasil)
  11. End Sub
  12.  
  13. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  14. Dim result As Integer = MsgBox("Apakah Anda Sudah Yakin Mau Keluar? ", MsgBoxStyle.Information + MsgBoxStyle.OkCancel, "Informasi")
  15. If result = DialogResult.OK Then
  16. Me.Close()
  17. Else
  18. End If
  19. End Sub
  20. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement