Skip to main content

Some basic syntax to deal with handlers

  • December 2, 2011
  • 2 replies
  • 0 views

[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

2 replies

Chris Glazier
Forum|alt.badge.img+2

[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

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...

[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
Thanks, Just I have found this example too:

set MsgArrivedEvent to type Delegate::Combine
        (
            MsgArrivedEvent,
            new MsgArrivedEventHandler(self::My_MsgArrivedEventCallback)
        ) as type MsgArrivedEventHandler