|
-
Nov 10th, 2000, 03:04 PM
#1
Thread Starter
Lively Member
I want to make a slot machine game. I have some pictures, you know them, the fruit stuff. I made a slot machine with numbers before, but that's no fun. So i want the same with pictures. Changing the text on a somethin is easy, just like fruit1.caption = "9". But here's my question:
How can I change a picture in a picturebox?
To VB or not to VB, that's the question...
-
Nov 10th, 2000, 03:15 PM
#2
Fanatic Member
Code:
Picture1.Picture = LoadPicture("FileName") '//Where FileName is a valid picture file on your computer
'//Or use the imageList Control (Microsoft Windows Common Controls)
Picture1.Picture = ImageList1.ListImages(Index).Picture '//Where Index is the index of the picture in the imagelist control
HTH
-
Nov 10th, 2000, 03:16 PM
#3
This will place Picture2 in Picture1.
Code:
Picture1 = Picture2
-
Nov 10th, 2000, 03:25 PM
#4
Frenzied Member
Code:
Dim MyPic(9) As StdPicture
'Creates An Array of 9 pictures (numbers or whatever)
Private Sub Form_Load()
Set MyPic(0) = LoadPicture(App.Path & "\0.bmp")
'where this would be the '0' picture
'make sure the pictures are in the same directory as your program
'....
'Do this for 1-8 all the way up to 9
Set MyPic(9) = LoadPicture(App.Path & "\9.bmp")
End Sub
Then in your events, do this
[code]
MyPictureBox.Picture = MyPic(0)
'you can set the picture to any of your 9 numbers
-
Nov 10th, 2000, 03:25 PM
#5
Thread Starter
Lively Member
To VB or not to VB, that's the question...
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
|