0

We need handler more detail in Textbox in our windows phone Application. when user input some string and textwrap support in textBox. how to increase height when text content textwrap in textbox?

as fllow:

  <StackPanel x:Name="BuildDefaltTask_SP" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <TextBox x:Name="AddNewTaskContent_TB" Height="150" Margin="-12" FontSize="26" FontWeight="ExtraBold" TextWrapping="Wrap" Style="{StaticResource TextBoxStyle}"></TextBox>
    </StackPanel>
kai chen
  • 358
  • 4
  • 19

1 Answers1

1

If you set the Height to Auto, then it should grow with the text as you enter more lines.

You can also do this from code: like Setting height of textbox to auto in code-behind for a dynamically created textbox

Or you can control the sizing yourself using MeasureText - Autoresize textbox control vertically

Community
  • 1
  • 1
Stuart
  • 66,722
  • 7
  • 114
  • 165