110,566
社区成员
发帖
与我相关
我的任务
分享
private void textBox4_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar==':')
{
e.Handled = true;
}
}
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if ((e.KeyChar >= '0' && e.KeyChar <= '9') || e.KeyChar == 8)
{
e.Handled = false;
}
else if (e.KeyChar == 58)
{
if (textBox1.Text.Length > 0)
{
e.Handled = false;
}
else
{
e.Handled = true;
}
}
else
{
e.Handled = true;
}
}