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
+1 -1
View File
@@ -35,6 +35,6 @@
<Image Grid.Column="7" Grid.Row="1" x:Name="Dealer_Bild_2"/> <Image Grid.Column="7" Grid.Row="1" x:Name="Dealer_Bild_2"/>
<Button Grid.Row="0" Content="Hauptmenü" HorizontalAlignment="Center" Click="Hauptmenue" Width="100"/> <Button Grid.Row="0" Content="Hauptmenü" HorizontalAlignment="Center" Click="Hauptmenue" Width="100"/>
<TextBox Grid.Column="3" HorizontalAlignment="Left" Height="101" Margin="10,36,0,0" Grid.Row="4" TextWrapping="Wrap" Text="Einsatz" VerticalAlignment="Top" Width="193" PreviewTextInput="TextBox_OnPreviewTextInput" PreviewKeyDown="TextBox_OnPreviewKeyDown" DataObject.Pasting="TextBox_Pasting"/> <TextBox Grid.Column="4" HorizontalAlignment="Left" Height="101" Margin="10,169,0,0" Grid.Row="2" TextWrapping="Wrap" Text="Einsatz" VerticalAlignment="Top" Width="193" Background="Blue" PreviewTextInput="TextBox_OnPreviewTextInput" PreviewKeyDown="TextBox_OnPreviewKeyDown" DataObject.Pasting="TextBox_Pasting" Grid.ColumnSpan="2"/>
</Grid> </Grid>
</Window> </Window>
+1 -1
View File
@@ -36,7 +36,7 @@
<Image Grid.Column="7" Grid.Row="2" x:Name="Bild_3"/> <Image Grid.Column="7" Grid.Row="2" x:Name="Bild_3"/>
<Image Grid.Column="9" Grid.Row="2" x:Name="Bild_4"/> <Image Grid.Column="9" Grid.Row="2" x:Name="Bild_4"/>
<Button Grid.Row="0" Content="Hauptmenü" HorizontalAlignment="Center" Click="Hauptmenue" Width="100"/> <Button Grid.Row="0" Content="Hauptmenü" HorizontalAlignment="Center" Click="Hauptmenue" Width="100"/>
<TextBox Grid.Column="3" HorizontalAlignment="Left" Height="101" Margin="10,36,0,0" Grid.Row="4" TextWrapping="Wrap" Text="Einsatz" VerticalAlignment="Top" Width="193" PreviewTextInput="TextBox_OnPreviewTextInput" PreviewKeyDown="TextBox_OnPreviewKeyDown" DataObject.Pasting="TextBox_Pasting"/> <TextBox Grid.Column="5" HorizontalAlignment="Left" Height="51" Grid.Row="1" Width="193" Background="DimGray" PreviewTextInput="TextBox_PreviewTextInput" PreviewKeyDown="TextBox_PreviewKeyDown" DataObject.Pasting="TextBox_Pasting"/>
</Grid> </Grid>
+6 -5
View File
@@ -69,17 +69,17 @@ namespace Casino
} }
//Numberfield
private static readonly Regex _regex = new Regex("[^0-9]+€"); // Regex to match non-numeric input private static readonly Regex _regex = new Regex("^[0-9]"); // Regex to match non-numeric input
//nur nummern //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 // Keine Spaces
private void TextBox_OnPreviewKeyDown(object sender, KeyEventArgs e) private void TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
{ {
if (e.Key == Key.Space) if (e.Key == Key.Space)
{ {
@@ -99,5 +99,6 @@ namespace Casino
} }
} }
} }
} }
} }
+2 -1
View File
@@ -43,7 +43,8 @@ namespace Casino
private void Busfahrer_Click(object sender, RoutedEventArgs e) private void Busfahrer_Click(object sender, RoutedEventArgs e)
{ {
Busfahrer slotsWindow = new Busfahrer();
slotsWindow.Show();
} }
} }
} }