Skip to main content

Syntax for creating an event


Can you tell me what the syntax would be for creating an event that can be called later by an event handler?

C# example:

       public event EventHandler CloseButtonPressed;

2 replies

Dominique Sacre
Forum|alt.badge.img+2

Can you tell me what the syntax would be for creating an event that can be called later by an event handler?

C# example:

       public event EventHandler CloseButtonPressed;

Hi Noj, the syntax will be something like:

01 CloseButtonPressed type EventHandler event.

You can attach/detach methods/delegates to the event using the ATTACH/DETACH verbs, e.g.:

attach method CloseButtonHandler to CloseButtonPressed

Robert.


Chris Glazier
Forum|alt.badge.img+4

Can you tell me what the syntax would be for creating an event that can be called later by an event handler?

C# example:

       public event EventHandler CloseButtonPressed;

There is an example program available that covers this as well.

On Start menu-->All Programs-->Visual COBOL group run Samples and then select COBOL for .NET in the left hand column and then Events in the right hand column.

Thanks.