Results 1 to 4 of 4

Thread: Picturebox changing image

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2012
    Posts
    142

    Picturebox changing image

    I am trying to make a 'puppet' change into a ball when I press e.g. the right arrow key. I used getasynckeystate(keys.right) to check for the key in a timer. The moving is working well but I don't have an idea how I can make it change in a picture of the 'puppet' changing which then changes into a ball. Does someone know how to do this?
    Thank you, Nick.

  2. #2
    Hyperactive Member Vexslasher's Avatar
    Join Date
    Feb 2010
    Posts
    429

    Re: Picturebox changing image

    Code:
    PictureBox1.Image = My.Resources.picname
    I think that's what you wanted

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2012
    Posts
    142

    Re: Picturebox changing image

    no, I know how to change it but I don't know how to make it changing to a ball with another pic between

  4. #4
    Hyperactive Member Vexslasher's Avatar
    Join Date
    Feb 2010
    Posts
    429

    Re: Picturebox changing image

    Put this code into your event for when you press the key
    Code:
            PictureBox1.Image = My.Resources.CHANGINGIMAGE
            Timer1.Interval = 2000 'displays the next image in 2 sec
            Timer1.Enabled = True
    and add a timer then add this code
    Code:
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            PictureBox1.Image = My.Resources.BALLIMAGE
        End Sub

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