Name
Event Statement
Syntax
[Public] EventeventName [(arglist)]-
Public Use: Optional
Type: Keyword
Indicates that the event is visible throughout the project
-
eventName Use: Required
Type: String literal
The name of the event
arglist is optional and has the following
syntax:
[ByVal | ByRef] varname[( )] [As type]
-
ByVal Use: Optional
Type: Keyword
The argument is passed by value; that is, a local copy of the variable is assigned the value of the argument.
-
ByRef Use: Optional
Type: Keyword
The argument is passed by reference; that is, the local variable is simply a reference to the argument being passed. All changes made to the local variable are reflected in the calling argument.
ByRefis the default method of passing variables.-
varname Use: Required
Type: String literal
The name of the local variable containing either the reference or value of the argument.
-
type Use: Optional
Type: Keyword
The data type of the argument. It can be Byte, Boolean, Char, Short, Integer, Long, Single, Double, Decimal, Date, String, Object, or any user-defined type, object type, or data type defined in the BCL.
Description
Defines a custom event that the object can raise at any time using
the RaiseEvent statement.
Rules at a Glance
The event declaration must be
Publicso that it is visible outside the object module; it cannot be declared asFriendorPrivate. However, thePublickeyword can be omitted from the declaration, since it is Public by default.An
Eventstatement can only appear in the Declarations section ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access