• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Adding Your Own Events

Just as you can add custom properties and methods to the classes that you build, you can also add custom events. You will often use custom events to return information back to the application code that uses them. For example, if an error occurs in the Class module, it is prudent to raise an event to the user of the class, notifying it that the error occurred. Error handling is one of the many uses of a custom event. To declare a custom event, place a Public Event statement in the General Declarations section of the Class module:

Public Event Speaking(strNameSaid As String)


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint