Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. ActiveX Events

ActiveX Events

Scheduled Pinned Locked Moved Visual Basic
helpquestioncom
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jerome Conus
    wrote on last edited by
    #1

    Hi ! I have an app (developped with VB6) which is dynamically creating several instances of the same ActiveX. Here is how I do it : Dim objFoo(3) As Object Private Sub Form_Load() Set objFoo(1) = Form1.Controls.Add("MyOCX.MyActiveX", "object0") Set objFoo(2) = Form1.Controls.Add("MyOCX.MyActiveX", "object1") Set objFoo(3) = Form1.Controls.Add("MyOCX.MyActiveX", "object2") objFoo(1).Visible = True objFoo(2).Top = 2000 objFoo(2).Visible = True End Sub The problem is that the ActiveX is raising an event in some situations. How can I handle this event in my app, and how will I know which instance of the ActiveX raised the event ? Thank you for your help ! Jerome

    D 1 Reply Last reply
    0
    • J Jerome Conus

      Hi ! I have an app (developped with VB6) which is dynamically creating several instances of the same ActiveX. Here is how I do it : Dim objFoo(3) As Object Private Sub Form_Load() Set objFoo(1) = Form1.Controls.Add("MyOCX.MyActiveX", "object0") Set objFoo(2) = Form1.Controls.Add("MyOCX.MyActiveX", "object1") Set objFoo(3) = Form1.Controls.Add("MyOCX.MyActiveX", "object2") objFoo(1).Visible = True objFoo(2).Top = 2000 objFoo(2).Visible = True End Sub The problem is that the ActiveX is raising an event in some situations. How can I handle this event in my app, and how will I know which instance of the ActiveX raised the event ? Thank you for your help ! Jerome

      D Offline
      D Offline
      David Wengier
      wrote on last edited by
      #2

      Instead of using an array of objects, use the VBControlExtender class. Declare it WithEvents and you will be able to receive events. You identify the object by its Name. -- David Wengier Sonork ID: 100.14177 - Ch00k

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups