4
Answers

Add a variable to a command

Matthias

Matthias

16y
2.1k
1
Hello Everyone,

I want to exchange a part of a command with a variable.

Have a look at this Code:

private void MakeNormal(int buttonNR)
        {
            button01.Text = "l";
        }

What I need now, is to change the 01 to the variable buttonNR.

How can I do this? The only possibility I could think of would be checking with IF-statements, but for many buttons that is a lot of code.

Any help is appreciated.

Btw: Why doesn't <code> something  </code> work?
Answers (4)