withEvents for dynamic activex control

selvamarcadu

Member
Joined
Jul 7, 2009
Messages
17
Programming Experience
Beginner
Hi all,
I have to create multiple child window each embedded with dsoframer activex control,

Like,the following,
Private Function add_activex_control()
...
Dim AxFramerControl1 As New AxDSOFramer.AxFramerControl
...
ChildForm.Controls.add(AxFramerControl1)
...
End Function

Now i need to handle On close events for each Axframercontrol1.I tried WithEvents but it could be done only at global scope.Declaring my AxFramerControl1 as a global variable,

Public WithEvents AxFramerControl1 As New AxDSOFramer.AxFramerControl

will not help me,because the old content of Activex control in a child form will not be available if i assign some other content to the same global variable.Thats why i am declaring that variable inside the function.


I welcome your ideas/suggestions.
 
withEvents for dynamic activex contro

Hi all,

I just found out the way,

AddHandler AxFramerControl1.OnDocumentClosed, AddressOf AxFramerControl1_OnDocumentClosed

has done the trick.





Thanks
Selvam
 
Back
Top