Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleMake a class that raises an event
Keywordsevent, raise event, RaiseEvent
CategoriesActiveX Controls, Software Engineering
 
Declare the event in the class as in:

    Public Event BadSsn(ByVal bad_ssn As String)

Raise it as in:

    RaiseEvent BadSsn(ssn)

In the main program, declare an instance of the class using the WithEvents keyword so the program can catch the event.

 
Private WithEvents ssn_checker As SSNChecker

Private Sub ssn_checker_BadSsn(ByVal bad_ssn As String)
    MsgBox bad_ssn & " has an incorrect format"
End Sub
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated