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;
}
}
精彩评论