Advertisement
Guest User

Untitled

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