|
-
Jan 19th, 2002, 02:39 PM
#1
Thread Starter
New Member
Adding Shapes during runtime
I need to add multiple shapes to my form during runtime . I would like to add these shapes as a dynamic control array. Any ideas from anyone?? Thanks in advance for any help.
-
Jan 20th, 2002, 06:42 AM
#2
New Member
-
Jan 20th, 2002, 05:48 PM
#3
Good Ol' Platypus
When you want to load another member, use this code:
VB Code:
Load Picture1(Picture1.UBound + 1)
I find this code very useful as it will find the last index in the control array and make one with an index one higher. Then you treat it like a normal control. To be able to do this, set a picturebox (eg. picture1)'s index property to 0. In a command button, run this code and (for example) randomize the left and top, maybe the width and height too.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Jan 20th, 2002, 05:49 PM
#4
Good Ol' Platypus
You can then save the index of the newly created control, and when it's clicked on again, make it invisible (or unload it)...
VB Code:
Picture1(ThisIndex).Visible = False
Unload Picture1(ThisIndex)
Cheers!
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Jan 21st, 2002, 06:56 PM
#5
Thread Starter
New Member
Thanks
Thanks for the help everyone. Much appreciated
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
|