locked
What is VB6's EventParameters in C# RRS feed

  • Question

  • Hi,

    What is VB6's EventParameters equivalent class/method in .NET framework? and how to get the event's parameters in C#.

    Thanks,

    Sunday, April 19, 2015 6:08 AM

Answers

  • .NET events are tied to event handlers by means of delegates, allowing you to create a single event handler for multiple objects.

    A .NET event handler typically contains two parameters. The first parameter, sender, provides a reference to the object that raised the event and the second parameter passes an object specific to the event that is being handled.

    Please refer to the following page for more information:

    Events and Event Handling for Visual Basic 6.0 Users: https://msdn.microsoft.com/en-us/library/fw640fe8%28v=vs.90%29.aspx?f=255&MSPPError=-2147217396


    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question.

    • Proposed as answer by Blackwood Sunday, April 19, 2015 6:29 PM
    • Marked as answer by Fred Bao Wednesday, April 29, 2015 1:58 AM
    Sunday, April 19, 2015 10:27 AM

All replies

  • Check this thread for an example on this:

    http://stackoverflow.com/questions/14058412/passing-parameter-to-an-event-handler


    Fouad Roumieh

    • Proposed as answer by Blackwood Sunday, April 19, 2015 3:16 PM
    Sunday, April 19, 2015 7:57 AM
  • .NET events are tied to event handlers by means of delegates, allowing you to create a single event handler for multiple objects.

    A .NET event handler typically contains two parameters. The first parameter, sender, provides a reference to the object that raised the event and the second parameter passes an object specific to the event that is being handled.

    Please refer to the following page for more information:

    Events and Event Handling for Visual Basic 6.0 Users: https://msdn.microsoft.com/en-us/library/fw640fe8%28v=vs.90%29.aspx?f=255&MSPPError=-2147217396


    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question.

    • Proposed as answer by Blackwood Sunday, April 19, 2015 6:29 PM
    • Marked as answer by Fred Bao Wednesday, April 29, 2015 1:58 AM
    Sunday, April 19, 2015 10:27 AM
  • Hi,

    My question is about the equivalence of the properties EventParameters  of VB6's EventInfo class in C#.

    In .NET EventInfo class does not contains direct property/method EventParameters .

    Thanks,

    Sunday, April 19, 2015 6:21 PM
  • Hi,

    My question is about the equivalence of the properties EventParameters  of VB6's EventInfo class in C#.

    In .NET EventInfo class does not contains direct property/method EventParameters .

    Thanks,

    Very few people will remember much about VB6, but the link that Magnus gave you is from Microsoft's guide to VB6 developers so it should help you do what you want in .Net.

    Maybe there is no direct equivalent to VB6 EventParameters, I have no idea. I'm sure that whatever it is you are trying to do can be done in .Net although the method of doing it may be different.

    Sunday, April 19, 2015 6:29 PM
  • Hi,

    My question is about the equivalence of the properties EventParameters  of VB6's EventInfo class in C#.

    In .NET EventInfo class does not contains direct property/method EventParameters .

    Thanks,

    Can you give an example of what does the EventParameters do in VB6?, I answered based on the second part of the question. 

    May be there is equivalence and maybe not. It could be implemented in different way.


    Fouad Roumieh

    Sunday, April 19, 2015 6:33 PM