private void clearBoard()
{
button1.Text = null;
button2.Text = null;
button3.Text = null;
button4.Text = null;
button5.Text = null;
button6.Text = null;
button7.Text = null;
button8.Text = null;
button9.Text = null;
}
我有9個按鈕。 (button1
- button9
)。我希望他們全部清除文字。 有沒有更有效的方法來做到這一點,而不是通常清除每一個?是否有影響形式上出現的幾個按鈕的快捷方式?
順便說一句,我知道我可以創建按鈕的數組,但在這裏,所有按鈕手動從窗口創建。所以也許在這裏是不可能的。
WinForms?的WebForms? ASP.NET MVC? WPF? –
我更喜歡製作我自己的按鈕列表。搜索窗體控件速度很慢。試試這個:列表