|
-
November 30th, 2007, 05:41 PM
#1
MenuItems - Unknowingly Handle Multiple OnClick Events
I have about 15 MenuItems and i would like them all to use the same onclick event rather than multicasting a new event handler for each one.
Is this possible? If so, how would my one event handler handle multiple possible object senders? Cast the sender to a MenuItem and act upon it?
Thanks,
-Mario
-
November 30th, 2007, 06:26 PM
#2
Re: MenuItems - Unknowingly Handle Multiple OnClick Events
That's what a Delegate is. Search it out here
It's built in.
-
December 2nd, 2007, 07:32 PM
#3
Re: MenuItems - Unknowingly Handle Multiple OnClick Events
This is a link that explain about event, delegate, and event handler.
Hope this can help, its help me to understand about event.
http://www.codeproject.com/csharp/ev...ndamentals.asp
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|