I want to show sample of my application
First I create one comboBox(comboBox1)and pictureBox(pictureBox1)
In comboBox1 have following 4 items
Blue hills
Sunset
Water lilies
Winter
And then write following code in comboBox1_SelectedIndexChanged event
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
string filepath = @"C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\" + comboBox1.SelectedItem.ToString().Trim() + ".jpg";
if(File.Exists(filepath)){
pictureBox1.ImageLocation = filepath;
pictureBox1.Load(filepath);
pictureBox1.Update();
pictureBox1.Refresh();
pictureBox1.Visible = true;
}
}
When started i make pictureBox1's visible is false.
Maybe helpful
Theingi Win