Advertisement
Guest User

Untitled

a guest
Apr 1st, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. Private Sub cmdEnter_Click()
  2. If cmdEnter.Caption = "Enter Fun Zone" Then
  3. Username = txtUsername.Text
  4. Password = txtPassword.Text
  5. Do While (Password = "") Or (Password <> "Ghost")
  6. MsgBox "Incorrect Password", 0 + 48, "Password"
  7. txtPassword.Text = ""
  8. Password = InputBox("Re-Enter your password: ", "Password")
  9. Loop
  10. If (Password = "Ghost") Then
  11. lblTop.Caption = "Welcome to The Fun Zone, " + Username + "!"
  12. fraFunZone.Visible = True
  13. txtFrom.Visible = True
  14. cmdEnter.Caption = "Enter Fun Zone"
  15. End If
  16. If cmdEnter.Caption = "Exit Fun Zone" Then
  17. End
  18. End If
  19. End If
  20. End Sub
  21.  
  22. Private Sub cmdGo_Click()
  23. If ((txtFrom.Text <> "") And (txtTo.Text <> "")) Then
  24. Dim startNum As Integer
  25. Dim endNum As Integer
  26. num = 1
  27. startNum = txtFrom.Text
  28. endNum = txtTo.Text
  29. lstOutput.AddItem startNum
  30. txtFrom.Text = ""
  31. txtTo.Text = ""
  32. ElseIf ((txtFrom.Text = "") Or (txtTo.Text = "")) Then
  33. MsgBox "Please enter values into the text boxes before hitting 'go'.", 0 = 48, "Error"
  34. End If
  35. If (endNum > startNum + num) Then
  36. lstOutput.Clear
  37. Do
  38. lstOutput.AddItem startNum
  39. startNum = startNum + num
  40. Loop Until (startNum = endNum)
  41. End If
  42. If (startNum > endNum) Then
  43. lstOutput.Clear
  44. Do
  45. startNum = startNum - num
  46. lstOutput.AddItem startNum
  47. Loop Until (startNum = endNum + 1)
  48. End If
  49. End Sub
  50.  
  51. Private Sub Form_Load()
  52. fraFunZone.Visible = False
  53. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement