I have a list of files and when I click on each one I want it to display a preview of the image. I think I have the write code but I'm not sure what goes in the ()
this.listBox1.MouseUp += new System.Windows.Forms.MouseEventHandler();
I want the click to do this
private void listBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
// get selected filename
string curItem = listBox1.SelectedItem.ToString();
// BitmapImage.UriSource must be in a BeginInit/EndInit block
BitmapImage myBitmapImage = new BitmapImage();
myBitmapImage.BeginInit();
myBitmapImage.UriSource = new Uri(@curItem);
myBitmapImage.DecodePixelWidth = 200;
myBitmapImage.EndInit();
uploadImage.Source = myBitmapImage;
}