随风而去

博客园 首页 新随笔 联系 订阅 管理
添加KeyPress 事件
private void TextBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!(char.IsNumber(e.KeyChar) || e.KeyChar == '\b'))
            {
                e.Handled = true;
            }
        }
posted on 2007-11-27 11:41  Aaron_Zhang  阅读(414)  评论(0)    收藏  举报