Martin Ch
Martin Ch

Reputation: 1367

One general context menu

I have one general context menu and for example 4 buttons and 4 textboxes - when I click on any of these buttons the context menu is opened and when I click on some items I would like to send this item to textbox, which was between button - I need to send some identificator to context menu to know which button open it and then to know where to send selected item. How can I do that? I am using c# Thanks

Upvotes: 0

Views: 135

Answers (1)

agent-j
agent-j

Reputation: 27903

this.ActiveControl will give you the button that has the focus. You can put the identifier in the Tag property of each button. This way, this.ActiveControl.Tag will give you the information you need.

Upvotes: 1

Related Questions