简体   繁体   中英

WP7 - Textbox cursor position error

I've got a text box (which I've made changes to by editing the template). I added a Scrollviewer to the border of the content element so that I have a horizontal scroll ability, just like the address bar text box in IE.

Now that I've added the ScrollViewer , when I select the text inside the text box the cursor is positioned incorrectly. A better way to illustrate this is below:

在此处输入图片说明

My XAML is:

<ScrollViewer Margin="{StaticResource PhoneTouchTargetOverhang}" Width="Auto" BorderThickness="3" HorizontalScrollBarVisibility="Hidden">
   <Border BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" Background="Transparent" Height="48" Width="Auto">
    <ContentControl x:Name="ContentElement" BorderThickness="0" HorizontalContentAlignment="Stretch" Margin="{StaticResource PhoneTextBoxInnerMargin}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="Stretch" Style="{StaticResource ContentControlStyle1}"/>
  </Border>
</ScrollViewer>

Basically that's it! all I added was that ScrollViewer and the error occurs. What can I do to solve this?

Thanks!

尝试给ScrollViewer一个固定的高度

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM