Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim x As Integer = randomGen.Next(0, 732)
Dim y As Integer = randomGen.Next(0, 440)
protetNum = protetNum + 1
Dim picturebox As New PictureBox
picturebox.Name = "protet" + protetNum.ToString
picturebox.SizeMode = PictureBoxSizeMode.StretchImage
picturebox.Image = System.Drawing.Bitmap.FromFile(My.Computer.FileSystem.GetName("jumping alien.gif"))
picturebox.Location = New Point(x, y)
Me.Controls.Add(picturebox)
If protetNum = 100 Then Timer1.Enabled = False
If protetNum <= 99 Then Timer1.Enabled = True
End Sub
That is run everytime a timer ticks. Here is the code so far for when the mouse enters the picturebox.
Private Sub picturebox_testpicEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseEnter
'This doesn't work. Don't know how to take the vague picturebox and turn into specifics.
My.Computer.Audio.Play("Death-01.wav")
End Sub
There may be more errors here than I thought, but my knowledge of VB is only so much. If it helps, this stumped my VB teacher as well.
Thanks!

New Topic/Question
Reply




MultiQuote







|