mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-26 05:02:36 +01:00
Allow controls in measurement converter
This commit is contained in:
parent
473897b011
commit
bd58bdf476
@ -4793,12 +4793,12 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
|
|
||||||
private void textBoxInput_KeyPress(object sender, KeyPressEventArgs e)
|
private void textBoxInput_KeyPress(object sender, KeyPressEventArgs e)
|
||||||
{
|
{
|
||||||
if (char.IsDigit(e.KeyChar))
|
if (char.IsControl(e.KeyChar) || char.IsDigit(e.KeyChar))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.KeyChar == Convert.ToChar(Keys.Back) || e.KeyChar == '.' || e.KeyChar == ',' || e.KeyChar == '-')
|
if (e.KeyChar == '.' && !((sender as TextBox).Text.IndexOf('.') > -1) || e.KeyChar == ',' || e.KeyChar == '-' && !((sender as TextBox).Text.IndexOf('-') > -1))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user