Remove MinHeight and MinWidth from TextBox and change HorizonalAlignment to Stretch
<TextBox Margin="0,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Top" x:Name = "gTBxInfo" TextWrapping="Wrap" AcceptsReturn="True" ScrollViewer.VerticalScrollBarVisibility="Auto" />
Edit:
If you want to resize the TextBox in both directions (horizontal and vertical), you will have to use a different container than the StackPanel , so the size of the TextBox is independent.
Something like that:
<Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="50"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Menu> <MenuItem Header="Find" x:Name="gMNuFind" Grid.Row="0"/> </Menu> <Button x:Name="gBuFind" Content=" Find " Margin="5,10,5,5" Grid.Row="1"/> <TextBox x:Name = "gTBxInfo" Margin="0,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" TextWrapping="Wrap" AcceptsReturn="True" ScrollViewer.VerticalScrollBarVisibility="Auto" Grid.Row="2"/> </Grid>
source share