ChrisMayhew
Member
- Joined
- Apr 2, 2009
- Messages
- 12
- Programming Experience
- 1-3
Hey
I am having a bit of an annoying picture box problem, I have a picture box on my form along with a combo box with a number of different options.
So anyway when a combo box item is selected I want it to look in the dataset for the selected item's row and pick out the image to load and then using an IF statement it sets the image (or should)
I have tried a number of different ways to get this working, I have tried them in the resources for the program and also tried the following code
If you get any of that then any help would be great
It seems like the picture box isn't redrawing or something?
Thanks,
Chris
Edit: Just to add it will load the first image which is the AusGP because thats the first option in the combo box, after that none of the others will load.
I am having a bit of an annoying picture box problem, I have a picture box on my form along with a combo box with a number of different options.
So anyway when a combo box item is selected I want it to look in the dataset for the selected item's row and pick out the image to load and then using an IF statement it sets the image (or should)
VB.NET:
Dim RaceImg As String = DS.Tables("tblRaces").Rows(ID).Item("RaceImg")
If RaceImg = "AusGP" Then
GP_Picture.Image = Image.FromFile("./Track Images/AusGP.png")
ElseIf RaceImg = "MalGP" Then
GP_Picture.Image = Image.FromFile("./Track Images/MalGP.png")
End If
I have tried a number of different ways to get this working, I have tried them in the resources for the program and also tried the following code
VB.NET:
GP_Picture.Image = "./Track Images/AusGP.png"
If you get any of that then any help would be great
It seems like the picture box isn't redrawing or something?
Thanks,
Chris
Edit: Just to add it will load the first image which is the AusGP because thats the first option in the combo box, after that none of the others will load.
Last edited: