我做了一個計算總價格的應用程序,我希望當點擊按鈕時,它將數量加1,但它只加1,當我再次單擊按鈕時,它不會不添加,有沒有辦法循環按鈕?當點擊按鈕時添加數字
這裏是我的示例代碼
int intclicks;
private void button10_Click(object sender, EventArgs e)
{
intclicks++;
int qty = 1;
{
if (intclicks > 0)
{
int totalqty;
totalqty = qty + 1;
textBox3.Text = totalqty.ToString();
totalPrice();
}
}
}
的totalPrice();
套在另一個textBox
, 感謝顯示總價。
我將'loop'標記改爲'events',這裏沒有循環。 – gdoron 2013-02-22 07:50:23