Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

 

:-)

X-Corp

Take a hit

  • *Experts*
Posted
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.
Posted

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

X-Corp

Take a hit

  • *Experts*
Posted
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.
Posted

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?

X-Corp

Take a hit

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...