Absent Member.
Absent Member.
808 views

Some basic syntax to deal with handlers

Jump to solution

[Migrated content. Thread originally posted on 02 December 2011]

Hello,

How could I write this sentence in Visual COBOL?

listView1.RetrieveVirtualItem += new RetrieveVirtualItemEventHandler(listView1_RetrieveVirtualItem);

Thank you
0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

invoke listView1::add_RetrieveVirtualItem(new System.Windows.Forms.RetrieveVirtualItemEventHandler(self::listView1_RetrieveVirtualItem)



There is a demo program for Event Handlers in Visual COBOL.
Take a look at C:\Users\Public\Documents\Micro Focus\Visual COBOL 2010\Samples\COBOL for .NET\Events
or open up the Samples Browser in the Visual COBOL group and choose Events.

The sample for Delegates might also be useful...

View solution in original post

0 Likes
2 Replies
Micro Focus Expert
Micro Focus Expert

invoke listView1::add_RetrieveVirtualItem(new System.Windows.Forms.RetrieveVirtualItemEventHandler(self::listView1_RetrieveVirtualItem)



There is a demo program for Event Handlers in Visual COBOL.
Take a look at C:\Users\Public\Documents\Micro Focus\Visual COBOL 2010\Samples\COBOL for .NET\Events
or open up the Samples Browser in the Visual COBOL group and choose Events.

The sample for Delegates might also be useful...

View solution in original post

0 Likes
Absent Member.
Absent Member.
Thanks, Just I have found this example too:

set MsgArrivedEvent to type Delegate::Combine
        (
            MsgArrivedEvent,
            new MsgArrivedEventHandler(self::My_MsgArrivedEventCallback)
        ) as type MsgArrivedEventHandler
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.