Zahlenbox repariert

This commit is contained in:
2026-09-09 11:13:58 +02:00
parent c9d8e5e072
commit 33b6c1838a
4 changed files with 10 additions and 8 deletions
+6 -5
View File
@@ -69,17 +69,17 @@ namespace Casino
}
private static readonly Regex _regex = new Regex("[^0-9]+€"); // Regex to match non-numeric input
//Numberfield
private static readonly Regex _regex = new Regex("^[0-9]"); // Regex to match non-numeric input
//nur nummern
private void TextBox_OnPreviewTextInput(object sender, TextCompositionEventArgs e)
private void TextBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
e.Handled = !_regex.IsMatch(e.Text);
e.Handled = !_regex.IsMatch(e.Text);
}
// Keine Spaces
private void TextBox_OnPreviewKeyDown(object sender, KeyEventArgs e)
private void TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Space)
{
@@ -99,5 +99,6 @@ namespace Casino
}
}
}
}
}