私はアプリケーションフォームに多数のボタンがあります。そして、私はすべてのボタンテキスト(比較)をチェックしたいと思います。どのように私はそれを達成することができますか?C#forループの変数
for (i = 1; i < 30; i++)
{
if (this.button1.Text == "Hello") //here is PROBLEM
{
//..some statement
}
}
ので、次回の.textはそうで .textセクションとをthis.buttonするために変更する必要がありますthis.button ...
this.button
[I]の.text機能していません。
は、このWindowsフォーム、WPF、Windowsのアプリですか...? – Konamiman
可能重複:http://stackoverflow.com/questions/3419159/how-to-get-all-child-controls-of-a-windows-forms-form-of-a-specific-type-button –