[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:
Private Sub Command1_Click()
If Text1.Text = "11" Or Text2.Text = "11" Then
'Save the text inside the textboxes
SaveSetting "MyApp", "General", "User", Text1.Text
SaveSetting "MyApp", "General", "User2", Text2.Text
MsgBox "Thanks for Registering!", vbExclamation, "Register"
'Unload Form
Unload Me
Else
MsgBox "Arrr... Wrong. Try again.", vbInformation, "Register"
Text1.SetFocus
End If
End Sub
Private Sub Command2_Click()
'Get rid of all text
Text2.Text = ""
Text1.Text = ""
SaveSetting "MyApp", "General", "User2", Text2.Text
SaveSetting "MyApp", "General", "User", Text1.Text
'Reset the Register
Hidden.Text = "d"
SaveSetting "MyApp", "General", "Reset", Hidden.Text
'Unload form
Unload Me
End Sub
Private Sub Command3_Click()
MsgBox "Sample on How to Make a Registration Form For Your Programme" & _
vbCrLf & "By Reynard Chan, Age 12" & _
vbCrLf & "Made with Visual Basic 6" & _
vbCrLf & "Located at: www.planet-source-code.com/vb/" & _
vbCrLf & "Please send comments at that site or: [email]@dbzfreak.cjb.net[/email]", vbInformation, "Register Sample"
End Sub
Private Sub Form_Load()
'Check if reseted
Hidden.Text = GetSetting("MyApp", "General", "Reset", Hidden.Text)
'Check if registered or not.
Text2.Text = GetSetting("MyApp", "General", "User2", Text2.Text)
Text1.Text = GetSetting("MyApp", "General", "User", Text1.Text)
If Text1.Text = "Reynard Chan" Or Text2.Text = "ED23498-28" Then
MsgBox "You've registered the programme! Woopee! ", vbInformation, "Registered!"
Else
MsgBox "Please register this programme now", vbExclamation, "Unregistered"
End If
End Sub
Re: [RESOLVED] load limited times
Put a break on it and step through to see what it is doing.