Blocking Underscore Input in TextBox
Hello All,
I'm trying to block underscore (_
) from being entered into a TextBox
but I'm having no luck:
private void CoupontextBox_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsSymbol('_'))
{
e.Handled = true;
}
}
Thanks in advance!