Re: [問題] 一個只能打數字的問題

看板C_Sharp (C#)作者 (tomex_ou)時間21年前 (2004/03/07 04:41), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/5 (看更多)
※ 引述《ghost777 (飄雪)》之銘言: : 我是想讓使用者在textbox輸入時 : 只能輸入數字和倒退 : 就是在textbox的keypress事件裡 : 先判斷使用者鍵入何鍵 : 如果是數字0~9和backspace以外的 : 就不動作 : 試了許久試不出來=.=" Try to write the rule in KeyDown() event of TextBox, but the point is how to modify the read-only KeyChar. ??? :D -- You're recommended to vist C_Sharp in PTT. We are the C#, resistance is futile. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.119.183.211 ※ 編輯: tomex 來自: 140.119.183.211 (03/06 20:59)
文章代碼(AID): #10IZTpjp (C_Sharp)
文章代碼(AID): #10IZTpjp (C_Sharp)