private void txt_producerName_KeyPress(object sender, KeyPressEventArgs e)
{
try
{
if (Convert.ToInt16(e.KeyChar) == 8)
backspaceflag = true;
else
backspaceflag = false;
if (char.IsNumber(e.KeyChar) || Convert.ToInt16(e.KeyChar) == 8)
{
e.Handled = false;
}
else
{
e.Handled = true;
}
}
catch (Exception ex)
{
}
}
{
try
{
if (Convert.ToInt16(e.KeyChar) == 8)
backspaceflag = true;
else
backspaceflag = false;
if (char.IsNumber(e.KeyChar) || Convert.ToInt16(e.KeyChar) == 8)
{
e.Handled = false;
}
else
{
e.Handled = true;
}
}
catch (Exception ex)
{
}
}
No comments:
Post a Comment