Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How do I call IScrollInfo.MakeVisible(visual,rect) to scroll somethign into view?

$
0
0

checked google, ms-help,
IScrollInfo.MakeVisible should do exactly what I want (according to description), it just doesn't seem to work

<ScollViewer Height=20>
  <StackPanel x:Name="newHell"
                      ScrollViewer.CanContentScroll="True"
                      ScrollViewer.VerticalScrollBarVisibility="Visible">
    <TextBlock Text="1" x:Name="tb1"/>
    <TextBlock Text="2" x:Name="tb2"/>
    <TextBlock Text="3" x:Name="tb3"/>
    <TextBlock Text="4" x:Name="tb4"/>
    <TextBlock Text="5" x:Name="tb5"/>
  </StackPanel>
</ScrollViewer>

..
some Button click closer to hell
{
  var s = (IScrollInfo)newHell;
  s.MakeVisible(tb3, ???);  <- want to make tb3 visible, HOW? what parameter value is requested to make this simple line of code work?
}


If you don't dig, you won't find it



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>