diff --git a/ZKuP/CreateParkausweis.xaml b/ZKuP/CreateParkausweis.xaml index a9ed116..65f5c2f 100644 --- a/ZKuP/CreateParkausweis.xaml +++ b/ZKuP/CreateParkausweis.xaml @@ -46,6 +46,7 @@ + @@ -65,7 +66,7 @@ - + @@ -74,16 +75,16 @@ - + - + - + - + diff --git a/ZKuP/CreateParkausweis.xaml.cs b/ZKuP/CreateParkausweis.xaml.cs index b7af6c8..53a14c1 100644 --- a/ZKuP/CreateParkausweis.xaml.cs +++ b/ZKuP/CreateParkausweis.xaml.cs @@ -512,13 +512,21 @@ namespace ZKuP private void tbDDigitsKennzeichen_PreviewTextInput(object sender, TextCompositionEventArgs e) { - if ((sender as TextBox).Text.Length >= 5) + if (e.Text != "H" && e.Text != "E" && (sender as TextBox).Text.Length >= 5) { e.Handled = true; return; } - if (!System.Text.RegularExpressions.Regex.IsMatch(e.Text, "^[0-9]*$")) + var tb = (TextBox)sender; + + // neuer Text unter Berücksichtigung von Selection (Ersetzung möglich) + string newText = tb.Text.Substring(0, tb.SelectionStart) + + e.Text + + tb.Text.Substring(tb.SelectionStart + tb.SelectionLength); + + + if (!System.Text.RegularExpressions.Regex.IsMatch(newText, @"^[0-9]+(?:E|H)?$")) { e.Handled = true; return; diff --git a/ZKuP/ImageView.xaml b/ZKuP/ImageView.xaml index f1ee872..921c080 100644 --- a/ZKuP/ImageView.xaml +++ b/ZKuP/ImageView.xaml @@ -9,7 +9,7 @@ Title="Unterschriftenanzeige" Height="370" Width="419" Loaded="Window_Loaded" LocationChanged="Window_LocationChanged"> - + diff --git a/ZKuP/ImageView.xaml.cs b/ZKuP/ImageView.xaml.cs index bdebc64..528a679 100644 --- a/ZKuP/ImageView.xaml.cs +++ b/ZKuP/ImageView.xaml.cs @@ -62,7 +62,13 @@ namespace ZKuP { Dispatcher.Invoke(new Action(() => { - if (!showComboBox) { dPDate.Visibility = cBSignature.Visibility = btnToday.Visibility = btnUp.Visibility = btnDown.Visibility = tbFilter.Visibility = lblFilter.Visibility = btnFiltern.Visibility = cbOnlyWithSignature.Visibility = Visibility.Collapsed; } + if (!showComboBox) + { + dPDate.Visibility = cBSignature.Visibility = btnToday.Visibility = btnUp.Visibility = btnDown.Visibility = tbFilter.Visibility = lblFilter.Visibility = btnFiltern.Visibility = cbOnlyWithSignature.Visibility = panelRB.Visibility = Visibility.Collapsed; + + imageSignature.Margin = new Thickness(10); + this.Height = imageSignature.ActualHeight + 50; + } else { cBSignature.Visibility = dPDate.Visibility = btnToday.Visibility = btnUp.Visibility = btnDown.Visibility = tbFilter.Visibility = lblFilter.Visibility = btnFiltern.Visibility = cbOnlyWithSignature.Visibility = Visibility.Visible; } })); diff --git a/ZKuP/MainWindow.xaml b/ZKuP/MainWindow.xaml index 1db41f3..3159133 100644 --- a/ZKuP/MainWindow.xaml +++ b/ZKuP/MainWindow.xaml @@ -120,47 +120,7 @@ - - - + @@ -203,59 +163,11 @@ - - + @@ -270,22 +182,11 @@ - - - - - + + + + + @@ -339,24 +240,7 @@