context menu owner

flynn

Regular
Joined
Jul 28, 2005
Messages
59
I have 2 textboxes (tbxCustomerName, tbxCustomerNumber) that has a custom context menu attached (cmMRUList).

The context menu has a sub-menu (MRUMenuItem_Recent) that contains the most-recently-used customer names. Within the click event (OnMRURecentItemClick(object sender, EventArgs e)) of the MRUMenuItem_Recent items, I need to get the text of the "parent" textbox that the context menu was initiated from. I've looked at the "sender" object to try to find the top level control, but to no avail. The "owner" property of the "sender" contains the context menu itself. Is there a way to get the top level control ?
 
When I step into the event handler to display the ".SourceControl", I print the following in the Immediate window:

? this.cmMRUList.SourceControl.Name
'this.cmMRUList.SourceControl' is null
 
Back
Top