|
-
Mar 1st, 2002, 04:45 PM
#1
Raising Events from ActiveX Control
I'm going to post this in the other forum, too.
Here's the deal...
I have an ActiveX control that I wrote. I have custom events that I raise from code like AxInitializationComplete, and ErrorTrapped.
When hosted on a vb form all my events raise as expected. When hosted on a web page in Internet Explorer, the only events that fire are ones in which RaiseEvent is called in an event raised by the control or its constituent controls.
I know some of you are going, "HUH?"
If I call RaiseEvent from any Method that I wrote, the event does not bubble up to IE. If I call RaiseEvent in say, cboInput_Click(), my events raise.
VB Code:
Option Explicit
Event ErrorTrapped()
Event AxInitializationComplete()
Event UserSelected()
Event ControlGotFocus()
Private Sub cboInput_LostFocus()
RaiseEvent UserSelected 'OK
End Sub
Private Sub UserControl_Initialize()
Call Init()
End Sub
Private Function Init()
RaiseEvent AxInitializationComplete 'Does Not Work
End Sub
-
Mar 4th, 2002, 05:00 AM
#2
Frenzied Member
Hi,
I don't think any event can be triggered before the control Initialize event is complete as the event sink isn't valid yet. Try putting a timer on the control and start it on the initialise event and trigger the event after, say, half a second?
-
Mar 4th, 2002, 05:13 PM
#3
Addicted Member
I had a similar problem, the controls on the control is not loaded until the init event is complete, there is another event usercontrol_show that triggers once everything is done, but it re-triggers every time the control is shown.
I can't think of any reason you would want an event to fire then anyway.
Some Days, i just get this feeling that i'm helping to write dozens of Viruses...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|