0
Check buttons c#
[RU]Работаем на с#,есть кнопки с названиями button1 button2 button3 ...,есть цикл for,нужно чтобы бралась кнопка оканчивающаяся цифрой равной значению переменной K. [ENG] Using C#. i have button1, button2, button3 ...., there is a for cycle, i need to work with each butto wich has ending of K! I need to check each button for (int K = 0; K<16; K++) { buttonK.Text... //some code }
1 Resposta
+ 1
Have a look at the tag property.
button.tag
In the tag you can store an identifier so you don't have to mis use the buttonname for it.
To check certain string conditions use
endswith, startswith and contains
https://www.dotnetperls.com/startswith