{
if (char.IsDigit(e.KeyChar))
{
e.Handled = false;
}
else
{
MessageBox.Show("請輸入數子");
e.Handled = true;
}
}
如果妳把 MessageBox.Show("請輸入數子");
註釋了,那麽妳輸入數字以外的字符都沒有反應
{
if (char.IsDigit(e.KeyChar))
{
e.Handled = false;
}
else
{
MessageBox.Show("請輸入數子");
e.Handled = true;
}
}
如果妳把 MessageBox.Show("請輸入數子");
註釋了,那麽妳輸入數字以外的字符都沒有反應