|
-
Jul 11th, 2004, 01:05 AM
#1
Thread Starter
Frenzied Member
picture property [RESOLVED]
Heh, been awhile since I've posted with an actual VB question, and I've forgotten a lot in that time.
Apparently you can't set a pictureboxes .picture property to an image path (I'm a hard interface kind of guy, if you like fancy graphics and hate reading, don't use my programs). This creates a problem because I have 3 sets of 52 different images (image1.gif, image2.gif, image3.gif.... in class1/ class2/ class3/) that I want to be able to load based upon a user's selection (of class). This of course could be achieved by making 3 difference frames, each with 52 pictureboxes already set with each of the 52 images, which would take me a few years to do.
I was hoping I could do something like:
VB Code:
Dim i As Integer
If Class = 1 Then
For i = 0 To 52
pic_item(i).picture = "C:\pathtoimage\class1\image" & i & ".gif"
Next i
End If
but apparently I can't
Is there a way to do this that doesn't involve me clicking 156+ different times??
Last edited by Skitchen8; Jul 11th, 2004 at 04:36 PM.
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
-
Jul 11th, 2004, 01:45 AM
#2
You need to use the LoadPicture function:
pic_item(i).picture = LoadPicture("C:\pathtoimage\class1\image" & i & ".gif")
"It's cold gin time again ..."
Check out my website here.
-
Jul 11th, 2004, 04:35 PM
#3
Thread Starter
Frenzied Member
Thanks man
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|