Step 1: For this, first we take an image control to show the images and two Buttons (one for showing the previous image and the another one is used to show the next image like this:
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Image Height="329" HorizontalAlignment="Left" Margin="101,66,0,0"
Name="img1" Stretch="Fill" VerticalAlignment="Top" Width="221"
Source="/Image%20Slider%20In%20Windows%20Phone7;component
/Image/Chrysanthemum.jpg" />
<Button Content="Back" Height="72" HorizontalAlignment="Left"
Margin="29,431,0,0" Name="btnprevious" VerticalAlignment="Top" Width="126" />
<Button Content="Next" Height="72" HorizontalAlignment="Left"
Margin="243,431,0,0" Name="btnnext" VerticalAlignment="Top" Width="126" />
</Grid>
<TextBox Height="72" Visibility="Collapsed" HorizontalAlignment="Left"
Margin="101,529,0,0" Name="textBox1" Text="1" VerticalAlignment="Top" Width="237" />
The Output Will be: 
Note: Here we use the TextBox to set the default value in it, which is used in our program. It can't be visible since we set its visbility property to "Collapsed".
Step 2: After that first we write the code for the OnClick event of the Next Button:
using System.Windows.Media.Imaging;
int a;
// Constructor
public MainPage()
{
InitializeComponent();
}
private void btnnext_Click(object sender, RoutedEventArgs e)
{
if (a == 0)
{
textBox1.Text = "1";
}
if (a == 1)
{
textBox1.Text = "2";
}
else if (a == 2)
{
textBox1.Text = "3";
}
else if (a == 3)
{
textBox1.Text = "4";
}




Join the conversation! Your thoughts help the community grow.