Well suppose that you ve added images to the Resources and you have them already in your Listbox. You can do this by writting the folowing code:
List<Image> list;
public Form1()
{
InitializeComponent();
list = new List<Image>();
list.Add(Properties.Resources.image1name);
list.Add(Properties.Resources.image2name);
list.Add(Properties.Resources.image3name);
//and so on...
}
private void Form1_Load(object sender, EventArgs e)
{
listBox1.DataSource = list;
}
Now that you have your Image objects in your listbox by clicking on one of them you should be able to display your image to the PictureBox by using this code.
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
pictureBox1.Image = (Image)listBox1.SelectedItem;
}
So you just generate the event and put the folowing code inside, You have to cast the items in the listbox otherwise you ll get an error.