Design Time Support for EventHandler

Discussion in 'ASP .Net Building Controls' started by wolfgang, Jul 11, 2008.

  1. wolfgang

    wolfgang Guest

    I implemented an event in a class as described in the Visual Studio
    2008 documentation:

    public EventHandler MyEvent;
    protected virtual void OnMyEvent(EventArgs e)
    if (MyEvent!= null) MyEvent(this, e);

    The event works as expected but Intellisense doesn't recognise it as
    eventhandler. MyEvent shows up as a public variable with a blue box
    icon. Therefore I can't create an eventhandler template pressing the
    <TAB>-key after the += as with the builtin events like Load.

    Surely some design time support attributes or code is missing but I
    wasn't able to find any information on how to tell Intellisense that
    MyEvent is an eventhandler.
    wolfgang, Jul 11, 2008
    1. Advertisements

  2. wolfgang

    Teemu Keiski Guest


    it should also have "event" keyword:

    public event EventHandler MyEvent;
    Teemu Keiski, Jul 13, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.