xcorp Posted October 31, 2003 Posted October 31, 2003 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. :-) Quote X-Corp Take a hit
*Experts* mutant Posted October 31, 2003 *Experts* Posted October 31, 2003 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. Quote
xcorp Posted October 31, 2003 Author Posted October 31, 2003 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 Quote X-Corp Take a hit
*Experts* mutant Posted October 31, 2003 *Experts* Posted October 31, 2003 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. Quote
xcorp Posted October 31, 2003 Author Posted October 31, 2003 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? Quote X-Corp Take a hit
xcorp Posted October 31, 2003 Author Posted October 31, 2003 Thanks man! You've always came through for me. Quote X-Corp Take a hit
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.