First off i just want to say thanks to anyone viewing this post i'm new here and this is my first ever question!
I have currently been given a small program that im trying to get working for my dissertation (i'm a biology student!!! and i have to code!) What im trying to do is place a grid of 50x50 squares, or 100x100 squares in a frame and then according to a number in an array that i have generated change the colours of the shapes.
Now i thought this would be pretty simple but i was wrong, i need to be able to click on the shapes (or other control if its easier) and place a new number into the array.
So i guess what i want to know is how do i go about changing the backcolour of a grid of 50x50 shapes/picture boxes. Using a for next loop such as the one i tried below.
i have tried using picture boxes but it wont allow me to have 2500 of them :S, i have also tried using control arrays of shapes such as Shape(0)1 - 50 as row 1 and Shape(1)1 as row 2 all the way to 49 but couldnt figure out how to place the co-ordinates in the code.Code:' a is the array of (50, 50, 2) ' Sizer is set by the user so for this it is 50. For X = 1 to Sizer For Y = 1 to Sizer If a(X, Y, 1) = 1 then Shape(need some way of placing X and Y co-ords in here).backcolour = red Else Shape(X, Y).backcolour = White End if Next Y Next X
Hopefully someone knows an easier way of doing this as its holding up my entire project.
Thanks for helping again! look forward to reading some suggestions




Reply With Quote