visual basic question... marshall, im looking at you

Do you have a technical question that doesn't really fit a specific console? Want some general info on electronics, hacking, making cookies, etc? Here's the place to ask! Go nuts.

Moderator:Moderators

Post Reply
User avatar
timmeh87
Senior Member
Posts:3047
Joined:Mon Nov 14, 2005 10:19 pm
Location:Ontario, Canada
visual basic question... marshall, im looking at you

Post by timmeh87 » Tue May 16, 2006 2:06 pm

how do i create an object at runtime? i need to have an arbitrary number of picture boxes on a form. now, i guess i could put a few hundred (yes, i need hundreds) off in the corner and use them as i need them, but im almost positive i can just sponataneously generate them as i need them.

any insight?

ps. visual basic 6
Image

"Linux is only free if your time is worthless"

User avatar
marshallh
Moderator
Posts:2986
Joined:Sat Sep 10, 2005 2:17 pm
360 GamerTag:marshallh
Location:here and there
Contact:

Post by marshallh » Tue May 16, 2006 2:14 pm

You just need one picturebox with the attributes set to what you want. Set its ArrayIndex to 0.

Make a command button or something, and put in

Code: Select all

For i = 1 to how_many_boxes_you_need
    Load picBlah(i)
    picBlah(i).Visible = True
    picBlah(i).Left = wherever
    picBlah(i).Top = wherever
Next
Image

User avatar
shmagoogin77
Portablizer
Posts:1469
Joined:Sun Apr 17, 2005 6:10 pm
Location:My desk
Contact:

Post by shmagoogin77 » Tue May 16, 2006 3:37 pm

your a guniess

Post Reply