diff --git a/KeyPage/KeyPageV.xaml b/KeyPage/KeyPageV.xaml index d6dbf87..abc8da8 100644 --- a/KeyPage/KeyPageV.xaml +++ b/KeyPage/KeyPageV.xaml @@ -14,7 +14,7 @@ - + @@ -119,10 +119,11 @@ Grid.Row="6" Style="{StaticResource ParametersTextBlock}"/> - + Style="{StaticResource ParameterTextBox}" TextWrapping="Wrap" AcceptsReturn="True" HorizontalContentAlignment="Left"/> textBoxNote.LineCount) Then + textBoxNote.Height = textBoxNote.Height - (originalTextBoxHeight * (numberOfLines - textBoxNote.LineCount)) + numberOfLines = textBoxNote.LineCount + End If + End Sub + End Class diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index e4f54cb..7f6d6f8 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -59,5 +59,5 @@ Imports System.Windows ' usando l'asterisco '*' come illustrato di seguito: ' - - + + diff --git a/NewLicencePage/NewLicencePageV.xaml b/NewLicencePage/NewLicencePageV.xaml index be080ea..5f9a248 100644 --- a/NewLicencePage/NewLicencePageV.xaml +++ b/NewLicencePage/NewLicencePageV.xaml @@ -158,10 +158,11 @@ Grid.Row="4" Style="{StaticResource ParametersTextBlock}"/> - + Style="{StaticResource ParameterTextBox}" TextWrapping="Wrap" AcceptsReturn="True" HorizontalContentAlignment="Left"/> diff --git a/NewLicencePage/NewLicencePageV.xaml.vb b/NewLicencePage/NewLicencePageV.xaml.vb index 1b59086..aa099c1 100644 --- a/NewLicencePage/NewLicencePageV.xaml.vb +++ b/NewLicencePage/NewLicencePageV.xaml.vb @@ -1,3 +1,20 @@ Public Class NewLicencePageV + Dim numberOfLines As Integer = 1 + Dim originalTextBoxHeight As Double = 22 + + Private Sub textBoxNote_TextChanged(sender As Object, e As TextChangedEventArgs) Handles textBoxNote.TextChanged + If (numberOfLines = 1) Then + textBoxNote.Height = originalTextBoxHeight + End If + If (numberOfLines < textBoxNote.LineCount) Then + textBoxNote.Height = originalTextBoxHeight * textBoxNote.LineCount + numberOfLines = textBoxNote.LineCount + End If + If (numberOfLines > textBoxNote.LineCount) Then + textBoxNote.Height = textBoxNote.Height - (originalTextBoxHeight * (numberOfLines - textBoxNote.LineCount)) + numberOfLines = textBoxNote.LineCount + End If + End Sub + End Class diff --git a/UpdateKeyPage/UpdateKeyPageV.xaml b/UpdateKeyPage/UpdateKeyPageV.xaml index 1db3884..2e89823 100644 --- a/UpdateKeyPage/UpdateKeyPageV.xaml +++ b/UpdateKeyPage/UpdateKeyPageV.xaml @@ -72,10 +72,11 @@ Grid.Row="3" Style="{StaticResource ParametersTextBlock}"/> - + Style="{StaticResource ParameterTextBox}" TextWrapping="Wrap" AcceptsReturn="True" HorizontalContentAlignment="Left"/> 0) Then + If (numberOfLines < textBoxNote.LineCount) Then + textBoxNote.Height = originalTextBoxHeight * textBoxNote.LineCount + numberOfLines = textBoxNote.LineCount + End If + If (numberOfLines > textBoxNote.LineCount) Then + textBoxNote.Height = textBoxNote.Height - (originalTextBoxHeight * (numberOfLines - textBoxNote.LineCount)) + numberOfLines = textBoxNote.LineCount + End If + End If + End Sub + End Class diff --git a/UpdateLicencePage/UpdateLicencePageV.xaml b/UpdateLicencePage/UpdateLicencePageV.xaml index 5295041..55391f7 100644 --- a/UpdateLicencePage/UpdateLicencePageV.xaml +++ b/UpdateLicencePage/UpdateLicencePageV.xaml @@ -126,10 +126,10 @@ Grid.Row="3" Style="{StaticResource ParametersTextBlock}"/> - + Style="{StaticResource ParameterTextBox}" TextWrapping="Wrap" AcceptsReturn="True" HorizontalContentAlignment="Left"/> diff --git a/UpdateLicencePage/UpdateLicencePageV.xaml.vb b/UpdateLicencePage/UpdateLicencePageV.xaml.vb index 01034f1..5bfb2ac 100644 --- a/UpdateLicencePage/UpdateLicencePageV.xaml.vb +++ b/UpdateLicencePage/UpdateLicencePageV.xaml.vb @@ -1,3 +1,22 @@ Class UpdateLicencePageV + Dim numberOfLines As Integer = 1 + Dim originalTextBoxHeight As Double = 22 + + Private Sub textBoxNote_TextChanged(sender As Object, e As TextChangedEventArgs) Handles textBoxNote.TextChanged + If (numberOfLines = 1) Then + textBoxNote.Height = originalTextBoxHeight + End If + If (textBoxNote.LineCount > 0) Then + If (numberOfLines < textBoxNote.LineCount) Then + textBoxNote.Height = originalTextBoxHeight * textBoxNote.LineCount + numberOfLines = textBoxNote.LineCount + End If + If (numberOfLines > textBoxNote.LineCount) Then + textBoxNote.Height = textBoxNote.Height - (originalTextBoxHeight * (numberOfLines - textBoxNote.LineCount)) + numberOfLines = textBoxNote.LineCount + End If + End If + End Sub + End Class