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:
01016424
Views:
10
>>Uhm, this maybe to obvious but, can't you just call the handler method directly?
>>
this.OnPopupHandler(this.mnuMyButton,EventArgs.Empty);
>>
Apologies, but I'm not too bright <g>. I don't get it. "this" would be my form (System.Windows.Forms.Form), so there's no .OnPopupHandler there. I haven't created the .Popup event, it's a member of MenuItem. To be honest, events in C# are a little murky for me, but whenever I've seen .OnxxxHandler, it's the naming convention when one creates one's own events.

There is a protected virtual MenuItem.OnPopup() method, MSDN says it will raise the MenuItem.Popup event, but I fail to see how I can take advantage of this. Even if I subclassed and override the .OnPopup, I can't call it from my form.

I hope I'm missing something obvious, thanks for your post.

Mike
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform