Wondermoose
Wondermoose

Reputation: 311

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.

Upvotes: 3

Views: 3136

Answers (2)

Xiaofeng Tang
Xiaofeng Tang

Reputation: 526

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

Upvotes: 1

AnthonyWJones
AnthonyWJones

Reputation: 189437

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

Upvotes: 1

Related Questions