I have two TextBoxes in the control , and I have in both of thems two VerticalScrollBar. I want to bind the VerticalScrollBars between them , if one goes up the secound will go also etc... Is it possible if so how i can do it ?
Thanks
Not a real binding but it works:
<TextBox Name="scrlTB1" Height="100" ScrollBar.Scroll="Scroll" ScrollViewer.VerticalScrollBarVisibility="Visible"/>
<TextBox Name="scrlTB2" Height="100" ScrollBar.Scroll="Scroll" ScrollViewer.VerticalScrollBarVisibility="Visible"/>
private void Scroll(object sender, ScrollEventArgs e)
{
if (sender == scrlTB1)
{
scrlTB2.ScrollToVerticalOffset(e.NewValue);
}
else
{
scrlTB1.ScrollToVerticalOffset(e.NewValue);
}
}
(This example ignores the possibility of horizontal scrolling)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With