- Megamax5000
- Posts: 3
- Joined:
Is there a way to set TextBox ScrollBar to be at the bottom?
Have dug around a bit an cannot find a solution to the problem. I have a TextBox that looks like this:
Every end of turn, this is populated with a play-by-play of the most recent turn. I would like the TextBox to start each turn scrolled all the way to the bottom rather than it's default which is starting at the top. I know that TextBox in xaml has the ScrollToEnd() method, but I can't get that to work in Noesis. When I try I get this error:
Assets/drawgame/XamlUI/Resources/GameHud.xaml.cs(45,23): error CS1061: Type `Noesis.TextBox' does not contain a definition for `ScrollToEnd' and no extension method `ScrollToEnd' of type `Noesis.TextBox' could be found. Are you missing an assembly reference?
Any work around for this?
Code: Select all
<TextBox
x:Name="BattleLogBox"
Grid.Column="2"
VerticalScrollBarVisibility="Auto"
ScrollViewer.CanContentScroll="True"
MaxLines="6" MinLines="4"
TextWrapping="Wrap"
Text="{Binding BattleText, Mode=OneWay}"/>
Assets/drawgame/XamlUI/Resources/GameHud.xaml.cs(45,23): error CS1061: Type `Noesis.TextBox' does not contain a definition for `ScrollToEnd' and no extension method `ScrollToEnd' of type `Noesis.TextBox' could be found. Are you missing an assembly reference?
Any work around for this?
-
sfernandez
Site Admin
- Posts: 2983
- Joined:
Re: Is there a way to set TextBox ScrollBar to be at the bottom?
ScrollToEnd method and similar are not implemented in Noesis TextBox yet, could you please create a ticket in our bugtracker to report it?
The workaround will be to look for the ScrollViewer inside TextBox template (using GetTemplateChild if you named it or iterate its children with VisualTreeHelper), and then use the ScrollViewer methods directly.
The workaround will be to look for the ScrollViewer inside TextBox template (using GetTemplateChild if you named it or iterate its children with VisualTreeHelper), and then use the ScrollViewer methods directly.
- Megamax5000
- Posts: 3
- Joined:
Re: Is there a way to set TextBox ScrollBar to be at the bottom?
Awesome, I just decided to use a ScrollViewer instead of a TextBox and then the ScrollViewer.ScrollToBottom() method worked just fine.
Added a bug as well. Thanks!
Added a bug as well. Thanks!
-
sfernandez
Site Admin
- Posts: 2983
- Joined:
Re: Is there a way to set TextBox ScrollBar to be at the bottom?
Thanks for the report.
Who is online
Users browsing this forum: Google [Bot], jayk.techabbot and 42 guests