Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. Public Class Latihan10
  2. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  3. Dim x%
  4. x = TextBox1.Text
  5. Do
  6. x = x Mod 2
  7. If x = 0 Then
  8. MsgBox("Genap")
  9. Exit Do
  10. ElseIf x = 1 Then
  11. MsgBox("Ganjil") 'laptopinformatika.com
  12. Exit Do
  13. End If
  14. Loop While Not x
  15. End Sub
  16.  
  17. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  18. TextBox1.Text = ""
  19. End Sub
  20.  
  21. Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  22. Dim result As Integer = MsgBox("Apakah Anda Sudah Yakin Mau Keluar? ", MsgBoxStyle.Information + MsgBoxStyle.OkCancel, "Informasi")
  23. If result = DialogResult.OK Then
  24. Me.Close()
  25. Else
  26. End If
  27. End Sub
  28. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement