Results 1 to 4 of 4

Thread: How to make a picturebox move?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2011
    Location
    London, UK
    Posts
    16

    How to make a picturebox move?

    I am wondering how to create an animation to move a picturebox without any user interaction such as mouse or keyboard.

    I need to move a picture box by a set of pre determined location paths.

    for example: move the object from location (20,50) to location (70,100)

    Thanks in advance

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How to make a picturebox move?

    If neither the mouse nor keyboard is being used, how does the picture box know it is supposed to move?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2011
    Location
    London, UK
    Posts
    16

    Re: How to make a picturebox move?

    Quote Originally Posted by Hack View Post
    If neither the mouse nor keyboard is being used, how does the picture box know it is supposed to move?
    I meant I want to tell the picture box were to go from actual code. giving start point and destination point

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: How to make a picturebox move?

    Most languages have a left, top property for their controls. In addition, they generally have a Move method, whether called Move or something else. So... picBox.Move x, y

    Don't know if .Net's control's have a Move method or not. If not, it is named something similar like Position or Location for example

    You'll probably also want a timer control that when the timer event triggers, you move your picturebox to the next set of coordinates. I'm sure you can find examples of timer usage in the .Net portion of the forums
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

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