top of page

Silverlight ScrollViewer Example

Updated: Mar 18, 2019

In this article we will be seeing how to create Silverlight ScrollViewer control.

ScrollViewer control is used to enable scrolling of content. It provides Horizontal/VerticalScrollBarVisibility properties that can be set to one of four values:



<ScrollViewer />

Steps Involved:

Creating a Silverlight Application:

  1. Open Visual Studio 2010.

  2. Go to File => New => Project.

  3. Select Silverlight from the Installed templates and choose the Silverlight Application template.Enter the Name and choose the location.

  4. Click OK.

  5. In the New Silverlight Application wizard check the "Host the Silverlight Application in a new Web site".

  6. Click OK.

Creating the UI:

Open MainPage.xaml file and replace the code with the following.

<UserControl xmlns:sdk="" x:Class="ScrollViewerControl.MainPage"  xmlns=""  xmlns:x=""  xmlns:d=""  xmlns:mc=""  mc:Ignorable="d"  d:DesignHeight="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White"> <ScrollViewer Height="300" Width="300"  VerticalScrollBarVisibility="Auto"  HorizontalScrollBarVisibility="Auto"> <ScrollViewer.Content> <StackPanel> <Image Source="/ ScrollViewerControl; component/Images/img4.png"></Image> </StackPanel> </ScrollViewer.Content> </ScrollViewer> </Grid> </UserControl>



bottom of page