0
is there a way to use a variable without stating which one?
I.e. Decide which button to use if they are named button1 button2... etc. and then run a method with that button?
3 Antworten
+ 1
Do you perhaps mean like a function?
Such as:
public void myFunction(button)
{
// Whatever the heck this function does.
}
// Function call
myFunction(button);
Or am I missing something?
0
You can bind all buttons to the same button_click event and make a switch statement in de button_click to call the right method.
Are you using wpf ? the you need to bind to the command parameter.
https://www.codeproject.com/Articles/238657/How-to-use-Commands-in-WPF
0
@Trackrise nope your spot on