cybermoonlight
asked on
copying objects
Please can soemeone help...i have a control on a form and i would like to be able to have an exact replica created when a button is clicked...the control in question is part of a control array....
basically i need to copy an object, clone it in other words..
thankyou very much
basically i need to copy an object, clone it in other words..
thankyou very much
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Your could use the "TypeLib Information" library (TLBINF32.DLL) to make a generic CopyObject function.
Just list all the source object properties, and for each, invokeHook-get from the source object and invokhook-put to the target object.
Use On Error Resume Next to skip read-only, and design-time only properties...
Just list all the source object properties, and for each, invokeHook-get from the source object and invokhook-put to the target object.
Use On Error Resume Next to skip read-only, and design-time only properties...
ASKER
cheers caraf..shame vb doesn't have a built in function....thankx
But here is some code
i = ubound(contarray)+1
load contarray(i)
contarray(i).move left,top, width, height
contarray(i).show