Results 1 to 4 of 4

Thread: Dynamically copy a frame and its controls?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    N42 29.340 W71 53.215
    Posts
    422

    Question Dynamically copy a frame and its controls?

    I have a frame as a control array, Frame1 w/index=0
    and there are controls on that also as arrays, e.g. Text1, Label1, etc. all with indexes=0.

    And I want to dynamically make a copy of that frame along with all its contained controls, each with index=1 now.

    I've tried looping through the Controls collection and checking for controls with Container="Frame1" and having an index, i.e. are control arrays.

    These are found fine, but, now how can I load new instances of these controls?

    The problem I've encountered is that in the Controls collection I can't Load one of these items because they are actual control instances and not control array objects (collections?).

    So, is there any way to reference a control array object/collection from an existing control instance in order to do a Load/Add of a new instance? Or am I barking up the wrong tree here? (my head hurts!)
    Thanks, DaveBo
    "The wise man doesn't know all the answers, but he knows where to find them."
    VBForums is one place, but for the really important stuff ... here's a clue 1Tim3:15

  2. #2
    Hyperactive Member tailz's Avatar
    Join Date
    Jul 2002
    Posts
    306
    Just coded this for you, is it any help...?
    Attached Files Attached Files

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    N42 29.340 W71 53.215
    Posts
    422

    Looking for more generic

    Tailz, That works, but requires hardcoding each specific control array's "Load xxx" statement.

    I'd like to be able to code something more generic, so I can pass an arbitrary frame into the routine and it will be duplicated.

    Thanks, DaveBo
    "The wise man doesn't know all the answers, but he knows where to find them."
    VBForums is one place, but for the really important stuff ... here's a clue 1Tim3:15

  4. #4
    Hyperactive Member tailz's Avatar
    Join Date
    Jul 2002
    Posts
    306
    ok... its just that you said you were creating a set of controls with index=0 at design time anyway so I couldn't see the prob.

    maybe I've mis-interpreted you, anyway, If you come up with something else I'd love to see it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width