Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 ?

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...