【问题标题】:How to increase height when it's textwrap in textBox?当它在文本框中的文本换行时如何增加高度?
【发布时间】:2012-08-08 10:51:04
【问题描述】:

我们需要在我们的 windows phone 应用程序的文本框中处理更多细节。 当用户在文本框中输入一些字符串和文本换行支持时。 文本框内文字换行时如何增加高度?

如下:

  <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>

【问题讨论】:

    标签: windows-phone-7 textbox word-wrap


    【解决方案1】:

    如果您将Height 设置为Auto,那么当您输入更多行时,它应该会随着文本增长。

    您也可以通过代码执行此操作:like Setting height of textbox to auto in code-behind for a dynamically created textbox

    或者您可以使用MeasureText - Autoresize textbox control vertically 自行控制大小

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-24
      • 2014-12-14
      • 1970-01-01
      • 2017-08-29
      • 2018-06-21
      相关资源
      最近更新 更多