Silverlight Image with Scroll Bar in VB.NET

In this article you will learn how to create an application in which a Image work with Scroll Bar in Silverlight.
  • 1852

In this article the control has a scroll viewer as the root element and a simple grid with one column and one row inside that. There is a large image inside the grid cell.

<
UserControl x:Class="SilverlightApplication29.MainPage"
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   Width="300" Height="300" Background
="Transparent" >
    <ScrollViewer
    x:Name="scrollViewImage"
    HorizontalScrollBarVisibility="Visible"
    VerticalScrollBarVisibility
="Visible" >
        <Grid
      x:Name="gridImageContainer"
      Background="Gray"
      ShowGridLines
="True">
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <Image  Source="Tulips.jpg"
         Grid.Row="0" Grid.Column
="0" >
            </Image>
        </Grid>
    </ScrollViewer>
</
UserControl>

When you run the above application code the output window shows like below given:

Output Window

a.gif

Conclusion

Hope this article help you to understand how to create an application in which a Image work with Scroll Bar in Silverlight.

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.