Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
(C#) Raise an Event
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01016081
Message ID:
01016338
Views:
8
Mike,

I'm pretty sure you can call the event handler directly by simply passing a reference to the object (the MenuItem in this case) and the proper event hander (new EventHandler(menu_Click)).

Another Update! The above should be new EventArgs() not EventHandler(menu_Click), my bad. Hopefully you understood what I meant instead of what I typed. ;)

Will that work for you?

Update! I forgot to add that this doesn't exactly reproduce raising an event because many objects could be registered to handle the event and this would only be notifying one of the event handlers, but it seems like it should work for your situation.

HTH,
Chad

>Thanks for the idea. I know what I'm doing seems bizarre. The why of it is explained in message ID 1015136.
>
>My current kludge is similar to yours. I added a sub MenuItem, and just set the .Visible property to false. Now the .Popup event gets fired.
>
>I'm not really happy with that solution, but it's working for now. But then I started to think "shouldn't I just be able to raise an event". If this was VB.NET, I think (not really sure) I could just use the RaiseEvent keyword.
>
>Just seems like this should be a simle thing.
>
>Thanks,
>Mike
_________________________________
There are 2 types of people in the world:
    Those who need closure
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform