2011年12月21日 星期三

C# 鍵盤 KeyChar 值的取得

private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            char Key_Char = e.KeyChar;//判斷按鍵的 Keychar
            MessageBox.Show(((int)(Key_Char)).ToString());//轉成整數顯示
        }



Key Char
1234567890Entera
495051525354555657581397

沒有留言:

張貼留言