CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2012

    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

    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?


  2. #2
    Join Date
    Jul 2001
    Sunny South Africa

    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 :
    All my Articles

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

    Talking Re: Load/Unload Object PROBLEM

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

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