본문으로 바로가기

텍스트에 숫자만 입력 가능하게

category Development/C# 2010. 7. 21. 13:15
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
    if (!(char.IsDigit(e.KeyChar) || e.KeyChar == Convert.ToChar(Keys.Back)))
    {
        e.Handled = true;
    }
}

'Development > C#' 카테고리의 다른 글

중복 실행 방지  (0) 2010.07.21
폼안의 모든 컨트롤 접근하기  (0) 2010.07.21
ComBox의 활용  (0) 2010.07.21
정규표현식  (0) 2010.07.21
세계기준시간(UTC) 편차  (0) 2010.07.21