- UID
- 75389
- 帖子
- 658
- 主題
- 88
- 精華
- 0
- 積分
- 365
- 楓幣
- 3611
- 威望
- 248
- 存款
- 500
- 贊助金額
- 0
- 推廣
- 0
- GP
- 6
- 閱讀權限
- 30
- 在線時間
- 2347 小時
- 註冊時間
- 2014-8-5
- 最後登入
- 2023-11-29
|
針對你說的小數點的問題,我的想法是把小數點按鈕的 click function 給另外寫。
這是我小數點按鈕的click事件- private void Dot_btm_Click(object sender, EventArgs e)
- {
- // If Result is 0 or op_pressed is true,
- // then clear display.
- if ((Result_txt.Text == string.Empty) || op_pressed)
- Result_txt.Text = "0.";
- op_pressed = false;
- if (Result_txt.Text.IndexOf(".") == -1) {
- // If Result_txt hasn't "." then
- Result_txt.Text += ".";
- }
- }
複製代碼 |
|