Results 1 to 6 of 6

Thread: Timer Created During Runtime

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2003
    Posts
    32

    Timer Created During Runtime

    How can I add procedure to Timers that are created during runtime?

    Code:
    Public Function NewApple()
            Dim picNewApple As PictureBox = New PictureBox()
            Dim tmrNewApple As Timer = New Timer()
            Dim AppleType As Integer = RandomNumber(100)
            Select Case AppleType
                Case Is >= 50
                    picNewApple.Image = Image.FromFile(Application.StartupPath & "\RedApple.gif")
                Case Is >= 25
                    picNewApple.Image = Image.FromFile(Application.StartupPath & "\GreenApple.gif")
                Case Is >= 15
                    picNewApple.Image = Image.FromFile(Application.StartupPath & "\GoldApple.gif")
                Case Is >= 0
                    picNewApple.Image = Image.FromFile(Application.StartupPath & "\WormApple.gif")
            End Select
            picNewApple.SizeMode = PictureBoxSizeMode.AutoSize
            picNewApple.Location = New System.Drawing.Point(RandomNumber(600), -51)
            picNewApple.BackColor = System.Drawing.Color.Transparent
            picNewApple.SendToBack()
            Me.Controls.Add(picNewApple)
        End Function
    I want the timer that is created to control the movement of the newly created apple. Anyone know?
    Last edited by LuvKnight; Apr 1st, 2003 at 07:10 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width