Changing picture from Listbox - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Changing picture from Listbox

DCADCA Posts: 1Member
Hi,

I have created a listbox wich changes text i textboxes.

But i need i to change pictures as well.

Lets call the picturebox = picbox1

And an image = pic1.gif and pic2.gif, wich i have imported to the picturebox

if (listbox1.SelectedIndex == 0)

{

txtbox1.Text = ("4");

txtbox2.Text = ("3");

txtbox3.Text = ("2");

txtbox4.Text = ("1");

// here should pic1.gif be.

}



if (listbox1.SelectedIndex == 1)

{
txtbox1.Text = ("8");
txtbox2.Text = ("7");
txtbox3.Text = ("6");
txtbox4.Text = ("5");
// here should pic2.gif be.
}



What should i add?

Sign In or Register to comment.