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

Hybrid View

  1. #1
    Join Date
    May 2012
    Posts
    3

    Load/Unload Object PROBLEM

    Hi everyone,

    I am currently making a tetris game where I will load 4 image boxes for each piece. Every time I clear a line, I put the cleared line's image boxes to .left = 0 and .top = 0.

    However, I have realized that after loading too many image boxes, my program becomes very laggy. Therefore I decided to try Unloading the image boxes after the line has been cleared, but then I get an error message from a part of my code where I use this something like this to control my image boxes:

    For Index = 0 to IndNum
    Image1(Index)....
    ......
    ......
    Next

    So basically the entire "For" process becomes messed up because it is missing an object which I no longer need. Is there a way around this?

    Thanks

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: Load/Unload Object PROBLEM

    I'd have made a usercontrol for each piece. This will be a combination of the four pictureboxes. Being just one control, it would have saved you a little bit of memory, and made your program more manageable.

    Anyways, have a look here :

    http://www.freevbcode.com/ShowCode.asp?ID=2815

    http://www.tek-tips.com/faqs.cfm?fid=3906

  3. #3
    Join Date
    Dec 2008
    Location
    Step Into(F11)
    Posts
    465

    Talking Re: Load/Unload Object PROBLEM

    yes HannesThGreaT Has given to you perfect solution .go for the those links .

    http://www.freevbcode.com/ShowCode.asp?ID=2815


    http://www.tek-tips.com/faqs.cfm?fid=3906

Tags for this Thread

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