January 17, 2021
Hot Topics:

Communicating over a Network

  • By Sam Huggill
  • Send Email »
  • More Articles »

The best way to handle errors is to use events.

In Visual Basic, you can create your own events. An example event might be when you click on a button:

Private Sub Command1_Click()

You call or 'raise' events using the RaiseEvent method. This method accepts one parameter, which is one of the events declared. You declare an event like this:

Public Event TextSent(TextContent As String)

The event procedure for this event will look like this:

Private Sub MyModule_TextSent(TextContent As String)

Page 6 of 7

This article was originally published on November 20, 2002

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date