N
N
Nikita Azarchenkov2017-05-02 19:31:56
WPF
Nikita Azarchenkov, 2017-05-02 19:31:56

How to refer to the object that caused the event?

There are several buttons that call one event handler. In the event handler, you need to write the content of the button that caused the event to the int variable. How to implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Usotsky, 2017-05-02
@AquariusStar

Usually we drag data from the sender. That is, ((Button)sender).Content. Only it returns by default the string type.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question