Results 1 to 20 of 20

Thread: [RESOLVED] load limited times

Threaded View

  1. #1

    Thread Starter
    Member bammoeller's Avatar
    Join Date
    Apr 2006
    Posts
    61

    Resolved [RESOLVED] load limited times

    Hi! i was wondering if i can put a limit on how many times my main form is loaded. after it has been loaded 10 or how many every times i would like it to call this form.
    Thanks
    VB Code:
    1. Private Sub Command1_Click()
    2. If Text1.Text = "11" Or Text2.Text = "11" Then
    3. 'Save the text inside the textboxes
    4. SaveSetting "MyApp", "General", "User", Text1.Text
    5. SaveSetting "MyApp", "General", "User2", Text2.Text
    6. MsgBox "Thanks for Registering!", vbExclamation, "Register"
    7. 'Unload Form
    8. Unload Me
    9. Else
    10. MsgBox "Arrr... Wrong. Try again.", vbInformation, "Register"
    11. Text1.SetFocus
    12. End If
    13. End Sub
    14.  
    15. Private Sub Command2_Click()
    16. 'Get rid of all text
    17. Text2.Text = ""
    18. Text1.Text = ""
    19. SaveSetting "MyApp", "General", "User2", Text2.Text
    20. SaveSetting "MyApp", "General", "User", Text1.Text
    21. 'Reset the Register
    22. Hidden.Text = "d"
    23. SaveSetting "MyApp", "General", "Reset", Hidden.Text
    24. 'Unload form
    25. Unload Me
    26. End Sub
    27.  
    28. Private Sub Command3_Click()
    29. MsgBox "Sample on How to Make a Registration Form For Your Programme" & _
    30. vbCrLf & "By Reynard Chan, Age 12" & _
    31. vbCrLf & "Made with Visual Basic 6" & _
    32. vbCrLf & "Located at: www.planet-source-code.com/vb/" & _
    33. vbCrLf & "Please send comments at that site or: [email]@dbzfreak.cjb.net[/email]", vbInformation, "Register Sample"
    34. End Sub
    35.  
    36. Private Sub Form_Load()
    37. 'Check if reseted
    38. Hidden.Text = GetSetting("MyApp", "General", "Reset", Hidden.Text)
    39. 'Check if registered or not.
    40. Text2.Text = GetSetting("MyApp", "General", "User2", Text2.Text)
    41. Text1.Text = GetSetting("MyApp", "General", "User", Text1.Text)
    42. If Text1.Text = "Reynard Chan" Or Text2.Text = "ED23498-28" Then
    43. MsgBox "You've registered the programme! Woopee! ", vbInformation, "Registered!"
    44. Else
    45. MsgBox "Please register this programme now", vbExclamation, "Unregistered"
    46. End If
    47. End Sub
    Last edited by bammoeller; May 23rd, 2006 at 11:34 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width