I have a ContextMenu that is assigned to 3 RichTextBox's (i.e., if you
right-click on any of the 3 RichTextBox's, you get the same ContextMenu).
My ContextMenu has 2 items, each of which have their own click event
handlers. When I click on any of the options in the ContextMenu, I want to
know which RichTextBox the ContextMenu is currently opened in, so I thought
I could check the SourceControl property. The problem is, the property is
never assigned (it is null). If I assign the ContextMenu to another
control, such as a Button, the SourceControl property is properly assigned
when I right-click on the button. Why is that? To work around this
problem, I use the MouseEnter event to update a private variable that tells
me where the mouse is, so when the ContextMenu is opened, I look at that
variable. Seems like a hack - is there a better way?