Picture Box and Combo Box

Joined
Dec 1, 2006
Messages
2
Programming Experience
Beginner
Ok let me warn you i am an extreme beginner at VB.net

What i need to do is when i select an item in a combo box i want something to appear in a picture box and a label......

Thanks Guys
 
set the label's Text property to whatever you want the label to say, and set the picturebox's image property to whatever images you want shown

you do this in the combobox's SelectedIndexChanged event
 
VB.NET:
    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        Me.PictureBox1.Image = "Your Image Here"
        Me.Label1.Text = "Your Text Here"
    End Sub


since I don't know how where the image is, i cant tell you how to appropriately show the image. if the image is stored in an imagelist then simply use the imagelist's Image(IndexOfTheImage) property or you could use Image.FromFile("File Path Here") to load an image from a file
 
Back
Top