问题:当我在TextBox
中输入大量文本时,无法看到光标。
描述:
- 每当用户在
TextBox
中输入文本时,如果输入的文本较多,则应启用滚动。 ScrollViewer
仅显示ScrollViewer
高度内的TextBox
内容。- 当我输入几行文本时,出现了问题(光标不可见)。
- 然后我会向下滚动以查看光标,在输入更多行后再次出现问题。
代码:
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="Scroll Content Inside Textbox" Style="{StaticResource PhoneTextNormalStyle}" Margin="25,0,180,0"/>
</StackPanel>
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<ScrollViewer Height="200"
VerticalAlignment="Top">
<TextBox x:Name="txtBody"
Width="200"
AcceptsReturn="True"
/>
</ScrollViewer>
</Grid>
</Grid>