Hi all,
I am trying to make a simple application, where when a user press a button, there will be 2 consecutive images shown inside the window with delay. Below is the source code
private void btnAddMore_Click(object sender, RoutedEventArgs e)
{
//first show image1 in window
FunctImage();
//put a "fake" delay
for (int i = 0; i < 1000000000; i++)
{
}
//draw image2 in the same position
FunctImage2();
}
//function to show image1
public void FunctImage()
{
System.Windows.Controls.Image img = new Image();
img.Source = new BitmapImage(new Uri(@"C:\1.jpg"));
img.Width = 100;
Content = img;
}
//function to show image2
public void FunctImage2()
{
System.Windows.Controls.Image img = new Image();
img.Source = new BitmapImage(new Uri(@"C:\2.jpg"));
img.Width = 100;
Content = img;
}
what I got when I pressed the button was only a delay and image2 was drawn.. I actually need to show image1 first and after some delay, image2 will be shown..
Thank you for the guiddance