Pregunta

I have a scrollviewer with a standard margin(0,0,0,0). If I click on the button the margin for the scrollviewer needs to be margin(0,0,0,90). How can I do this in the code?

¿Fue útil?

Solución

 YourScroller.Margin = new Thickness(0,0,0,90);

On your button click

Otros consejos

I assume mainscrollviewer is your scrollviewer x:name

//Button click
 private void ButtonClick_Click_1(object sender, RoutedEventArgs e)
        {
            mainscrollviewer.Margin = new Thickness(0, 0, 0, 90);
        }

On your button click set it programatically:

 ScrollViewer.Margin = new System.Windows.Thickness(0, 0, 0, 90);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top