How to handle events of dynamically created ActiveX control (VB6)


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: How to handle events of dynamically created ActiveX control (VB6)

  1. #1
    Lela Guest

    How to handle events of dynamically created ActiveX control (VB6)


    I have user control (ActiveX) with custom events. In the application's main
    form controls are created an destroyed dynamically in run time.
    How can I handle control's events when I can not see controls (and it's events/methods)
    in drop down lists of the form's code window.

  2. #2
    Bernie Guest

    Re: How to handle events of dynamically created ActiveX control (VB6)


    "Lela" <vb.@127.0.0.1> wrote:
    >
    >I have user control (ActiveX) with custom events. In the application's main
    >form controls are created an destroyed dynamically in run time.
    >How can I handle control's events when I can not see controls (and it's

    events/methods)
    >in drop down lists of the form's code window.


    Hi,

    The most convenient way is to 'plant a seed' of every control that may be
    created during runtime. Those 'seeds' that should be invisible, should have
    an index=0 and any runtime-created clone (use Load/Unload) gets the next
    availible index-number. The events are there when coding and all you have
    to do is to keep track of the runtime-created control's index-number. And
    you don't need to bother about license-keys if the control demands it to
    load(!)

    However it is possible to create them completely from scratch and catch the
    events. Look on the samples on VB's setup disk. You will find one sample
    there that creates some controls this way, controls that are defined in an
    Access DB(!)

    Still I strongly recommend the first method using seeds... (Why complicate
    things if there is a simple way?)

    Bernie




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center