Help Raising Events in User Controls 
Author Message
 Help Raising Events in User Controls

I am a newbie VB programmer and I am only now begining to delve into OOP and
VB. My questions right now are  regarding Raising Events when designing User
Controls.

Firstly do we need to raise ALL the events in our user control? Won't some
events simply fire on their own. I had a user control with a command button on
it, and that button ran it's code when I clicked on it during run-time without
me ever having put a Raise Click Event in it's code.

Secondly I have seen examples of  values given as an  Event Procedure's
arguments while it is being raised. What happens to these values?

Thanks in advance for any help,
Falc



Sat, 13 Jul 2002 03:00:00 GMT  
 Help Raising Events in User Controls
The RaiseEvent command is designed for use in a control which needs to
communicate certain activities with its host.  For example, I wrapped the
MSComm control in a user control and had the user control fire an event only
when MSComm detected a certain character (which indicated that the received
message was complete).  Inside my user control, I depended on the OnComm
event within MSComm to fire by itself and it does (much like your experience
with the Click event).  As the designer of the control, you must determine
what kind of information must be communicated to a host and how.  An event
is one method.

As for Event arguments, these may contain information about the event so
that the host may react accordingly.  For example, you could pass a status
through an event argument which the host could review using If..Then or
Select Case.

Does that help?

Joe

<snip>



Sat, 13 Jul 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. HELP!!! raising events from a custom control

2. Need help with raising event in New() event in a base form

3. Can UserControls receive User-raised events?

4. PRB: Err.Raise in a user defined Event

5. PRB: Err.Raise in a user defined Event

6. raising an event from an activeX control on a htm page in a webbrower control

7. Raising Custom Active X Controls Events when using Data Repeater Control

8. raising an event from an activeX control on a htm page in a webbrower control

9. Detecting which control raised an event

10. How to Raise/Simluate an Event via Code for a existing Control

11. Q: Raising events in webbrowser control

12. Raising Custom Events in an OCX Control

 

 
Powered by phpBB® Forum Software