Quick Question - Jumping To Subs

xcorp

Freshman
Joined
Jul 10, 2003
Messages
35
Location
bc canada
Hey, I'm just fooling around with vbet.net and I came across a program where I'd like to jump to another sub.

I have it so I set the timer up, activate it but I wanna jump to

private_sub(timer1_tick) blah blah blah.

So it does stuff.

I can't figure out the command to jump to or run another sub.

Help would be appriciated.

:-)
 
If you want to jump to another sub simply using its name and if required arguments will work. I don't know if Im understanding your question right.
 
I'm not sure if you are. hehe

Okay, say I have a sub.

Private sub button1_click (by val handeler) blah blah blah

timer1.enabled = true

end sub

Now, in that sub, I wanna jump to

Private sub timer1_tick(byval handler blah blah blah)

<stuffhere>

end sub

To make the timer actually do stuff.

Do you sorta get what I'm saying now?

I wanna jump to a different sub
 
You dont need to jump to the event handlers. They will be executed automatically when the event is raised. Simply use the Start() method of the Timer and when the interval is reached the code will be executed.
 
Oh.. I get it.

So if I have.. well.. this is exact code from my program check it out ::::


Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
oldpasscheck = InputBox("Old Password (if none press enter)")
If oldpasscheck = pass Then
pass = InputBox("New Password")
Else : MsgBox("Incorrect Old Password!")
End

End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If RadioButton1.Checked = True Then
Timer1.Interval = 300000
Timer1.Enabled = True
Timer1.Start()

If RadioButton1.Checked = True Then
Timer1.Interval = 600000
Timer1.Enabled = True
Timer1.Start()








End If
End If


End Sub


Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
MsgBox("hey")

End Sub
End Class

<------------------------------------------->

Now I know the "msgbox" thing is bad and stuff.

But thats not what I"m doing. I"m executing a bunch of beeps but I havn't gotten that for so I just bumped that in as an example of code I might wanna execute

That thing will work? so every.. howmany miliseconds I set it for it will make the msgbox?
 
Back
Top