Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Silverlight Textbox scrollviewer problem

In silverlight,

  1. I got a textbox which I want to be multiline and have mousescrolling available.
  2. If I only use textbox then I dont have mousescrolling.
  3. If I use a scrollviewer I will have mousescrolling. BUT everytime my writing exceeds the rows that are shown from start the text and caret just dissapears without the scrollviewer doing anything.
  4. How do I solve the problem so I get the caretposition effects the scrollviewer?

I sofar not managed to find someone with the exact same problem as me.

like image 858
Wondermoose Avatar asked Jul 05 '26 02:07

Wondermoose


2 Answers

AnthonyWJones is probably correct on this.

PageScrollViewer will override some scroll settings of TextBox (as Child of ScrollViewer). If you want TextBox's scroll bar and wrapping come to take effects, you need to disable Horizontal scroll bar of scroll viewer:

<ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}" HorizontalScrollBarVisibility="Disabled">
like image 101
Xiaofeng Tang Avatar answered Jul 07 '26 02:07

Xiaofeng Tang


Stop using a scroll viewer and set the TextBox VerticalScrollBarVisibility property to Auto.

like image 35
AnthonyWJones Avatar answered Jul 07 '26 02:07

AnthonyWJones