|
-
Sep 2nd, 2000, 11:16 AM
#1
Thread Starter
New Member
Hello everyone,
I am in the process of designing a way to play the Star Wars Customizable Card Game over the internet. But that is irrelevant. Basically, if anyone can help, I would like to know how to duplicate a picture box on a form through code in run-time, because I need to do this during certain points in the game, and the deck sizes can be different, so I need to variably create these cards during run-time. Do I have to somehow create a Class for a PictureBox. I have no clue, and if anyone at all can help me I would extremely appreciate it. Thanks for reading this.
Kevin
-
Sep 2nd, 2000, 11:23 AM
#2
The picture box has to be part of a control array (set the Index property to 0).
Now you can load a new picture box.
Code:
Public Sub AddPicture()
Dim iUbound%
'this code assumes your picture box is called Picture1
iUbound = Picture1.UBound + 1
Load Picture1(iUBound)
With Picture1(iUBound)
'change the newLeft and newTop
'to correct values
.Move newLeft, newTop
.Visible = True
End With
End Sub
Good luck!
-
Sep 2nd, 2000, 11:26 AM
#3
Lively Member
put the first picturebox on your form as an array
(set the index property to 0)
then create the new pictures with
Load Picture1(num)
num starts with 1
-
Sep 2nd, 2000, 11:31 AM
#4
Thread Starter
New Member
Ok, great, thank you very much for both of your help, and I got it working. That was a very quick response, and that is great. Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|