DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  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




Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links