|
-
Apr 16th, 2002, 12:51 PM
#1
problems with ARRAYS!
help!i have an array of images (they are actually a noughts and crosses board) that i wish to change the picture property of. the code I am using is:
imgsquare().Picture = LoadPicture("Clear.bmp")
i know i need a snippet of code in the () to select the entire array, but i'm not sure how. i've tried (0 to 8) but that doesn't work, neither does ().
using (0 to 8) gives a compile error - expected - end of statement.
using () gives a compile error - method or data member not found...
this is really bugging me! anyone who thinks they can help please feel free to email me for complete code. 
thanks
dgr
-
Apr 16th, 2002, 12:53 PM
#2
Fanatic Member
you have to specify what element in the array the picture will go. so...
VB Code:
imgsquare(0).Picture = LoadPicture("Clear.bmp")
-
Apr 16th, 2002, 01:01 PM
#3
thanks for the reply, unofrtunatly this would require me to type the code 9 times, once for each element of the array. not a good use of code...
-
Apr 16th, 2002, 01:10 PM
#4
Not NoteMe
I think this is the shortest way to do it...
VB Code:
For i = 0 to 9
imgsquare(0).Picture = LoadPicture("Clear.bmp")
Next i
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
-
Apr 16th, 2002, 01:13 PM
#5
i think you mean:
For i = 0 To 9
imgsquare(i ).Picture = LoadPicture("Clear.bmp")
Next i
thanks loads for both of your answers!
i'll be back soon (to ask another question, or to answer someone elses - when i learn a bit more about vb )
dgr
-
Apr 16th, 2002, 01:17 PM
#6
Not NoteMe
Originally posted by dgr
i think you mean:
For i = 0 To 9
imgsquare(i ).Picture = LoadPicture("Clear.bmp")
Next i
Oops
Serves me right for doing a cut & paste job
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
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
|