PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms Strange Behavior with MenuItem Click Event

Reply

Strange Behavior with MenuItem Click Event

 
Thread Tools Rate Thread
Old 03-11-2003, 09:35 PM   #1
Marvin Addison
Guest
 
Posts: n/a
Default Strange Behavior with MenuItem Click Event


I have a handler for a MenuItem.Click event. I expected the sender
parameter to be a _reference_ to the actual menu item I added, but the
GetHashCode() method applied to the item I add and again to the sender
object return different values. Can anyone confirm if this behavior
is by design, and if so, shed some light on why it's implemented this
way. In my work with delegates, I've always assumed they were
references, so I need to know if/when this is not the case.

Thanks,
Marvin
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off