flynn Posted July 14, 2008 Posted July 14, 2008 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 ? Quote
Administrators PlausiblyDamp Posted July 14, 2008 Administrators Posted July 14, 2008 The context menu should have a .SourceControl property - that will be the control the menu is opened on. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
flynn Posted July 14, 2008 Author Posted July 14, 2008 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.