开发者

How to make array of textboxes accept only specific alphabets?

i am using visual studio c#.net winform and i have 2d array of 81 textboxes. . . i can't figured out how it is possible to make these textboxe开发者_JS百科s accept only specific alphabet. . . can any one please show me the code. . . THanx in advance


private void textBox_KeyPress(object sender, KeyPressEventArgs e)
{
    List<char> chrs = new List<char>{'1', '2', '3'};
    if (!chrs.Contains(e.KeyChar))
    {
        e.Handled = true;
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜