Results 1 to 6 of 6

Thread: Dynamic controls and their event handling

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Posts
    17

    Question

    After dynamically creating a control during run time using VbControlExtender object, I can only access the events for the most recently created object in the ObjectEvent event.

    Though it is probably impossible I am trying to find a way to code events for every control created dynamically.


  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Dunmow,Essex,England
    Posts
    898
    THe only way I can think of this is to create 1 of each regardless (It's a bit like when you place a single text box on a form then in code you may create a new text box on the form.) then as a new one is created create a control array of that type, then the new one will inherit all events of the original.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Posts
    17
    If I understand what you mean correctly, the difficulty is that vb will not allow me to create a control array at runtime, nor have I found a way to dynamically add to an existing control array.

    If I am missing your point please let me know.
    Thank you very much for your thoughts on the matter.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Posts
    17

    problem solved

    Forget about the VbControlExtender!
    I forgot that you can dynamically instantiate
    new controls that are already part of a control array
    in design time.

    Sub Whatever()
    Load NewDamnControl(NewIndex)
    End Sub

    Geeze. it is so simple im sick!

  5. #5
    Hyperactive Member tumblingdown's Avatar
    Join Date
    Mar 2000
    Posts
    362
    yep, groovy isn't it ;-!


    td.
    "One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig


    [email protected]

    "but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Posts
    17
    yeah when applied to activex controls you can do some add some pretty awsome flexibility.

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