umm how do I work with it?
I'm declaring a new Timer object and adding a handle to its Elapsed event. Seems like my app hangs for some reason. Is there any dumb things that I can be doing wrnog?
I'm doing soemthing like this:
Dim t as new timer(2000)
....
t.start
addhandler t.elapsed, addressof blah
this is the whole thing in case you are interested to know. It's supposed to show the button two seconds after the mouse is hovered on the picturebox
VB Code:
Private t As New Timer(2000) Private Sub PictureBox1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseEnter t.Start() End Sub Private Sub PictureBox1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.MouseLeave t.Stop() Button1.Visible = False End Sub Private Sub MouseHover2Seconds(ByVal sender As Object, ByVal e As ElapsedEventArgs) Button1.Visible = True End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load AddHandler t.Elapsed, AddressOf MouseHover2Seconds End Sub
very ingenious, right, hehe.




Reply With Quote