CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Moving Picboxs

  1. #1
    Join Date
    Mar 2001
    Posts
    8

    Moving Picboxs

    Does anyone have code to move a picbox from one side of a form to another. I am creating a little shooting range type game and would like to have the target(BMP) picbox move across the form.



  2. #2
    Join Date
    Jun 2000
    Location
    Nepal
    Posts
    108

    Re: Moving Picboxs

    Moving the picture box is not the approach to making games. The fastest you will attain using VB and the API is by putting your sprite on an invisible picturebox and use BitBlt() to copy the image to different parts of the form.

    IF you still insist with moving the picturebox, the code below will do it.


    form1.scalemode = 3 'Pixel
    picture1.left = 0
    for i = 0 to form1.scalewidth - picture1.width
    picture1.left = i
    next





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

Featured