|
-
August 23rd, 2001, 10:04 AM
#1
Copying Controls
I am trying to, at RUN time, copy and paste a Control (a picture box) on a Form without using the mouse’s ‘right click’ Copy/Paste feature.
I have a Control Array of Picture Boxes. Picture1(0), Picture1(1), etc… These picture boxes are contained in a larger empty Picture2 box.
On a click event, I am trying to copy the particular picture box control, and paste the duplicate anywhere on the Picture2 box. The newly formed picture box should be the next element of the control array, and the new control should be dragable anywhere on the form – which John from CodeGuru has already helped me with.
Here is what I have tried:
First, in the picture box module, I copy the control to the Clipboard (after clearing the clipboard) using the Copy method (I’m not even sure I’m using that command properly).
Then I create a new instance for the new Picture box, Picture1 (Index +1) using the Add method (is this right?)
But then pasting or assigning the new cloned picture box, with its new index, e.g. Picture1(8) onto the form does not work.
Since the control array is already established, I should not have to declare the new control array in a Dim statement, right?
The Copy Method makes sense, but my syntax must be way off as I can’t figure out what object I should be copying: the Picture, the Picture1(Index), or the Picture.box?
Thanks again.
<Strong>Wendell W. Wilson</Strong>
<EM>Software Engineer</EM>
St. Petersburg, FL
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
|