Results 1 to 3 of 3

Thread: Moving Multiple Picture Boxes - lag?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2007
    Posts
    70

    Moving Multiple Picture Boxes - lag?

    On my form I have a control array of 239 picture boxes NOT being moved. Then I create 5 picture boxes of a new control array and move them with a timer with the interval set to 10. It moves fine, but when I load another 5 picture boxes totaling 10 the game starts to lag by the images starting to move slower then set to. The more I load and more the slower it keeps getting.

    I am increasing the .top of all of the picture boxes by 25 every time the timer ticks with a 10 interval.

    How can I prevent this 'lag'?

  2. #2
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Moving Multiple Picture Boxes - lag?

    Not sure this helps your situation but in a program I have that moves a large array of labels I toggle the .visible property before and after the move and it helped speed up the moving.
    Code:
    For i = 0 To Lbl.Count -1
        Lbl(i).Visible = False
        Lbl(i).Top = Lbl(i).Top - 1    
        Lbl(i).Visible = True
    Next i

  3. #3
    Fanatic Member
    Join Date
    Aug 2007
    Posts
    912

    Re: Moving Multiple Picture Boxes - lag?

    here is something i have for you, in this attachment
    Attached Files Attached Files

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