Question

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?

Était-ce utile?

La solution

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

On your button click

Autres conseils

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);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top