|
Answer» I've been trying to figure this out for days and can't get it. I've tried looking up on google how to do it but nonetheless, I can't seem to find a solution that works.
I'm USING Visual Studio 2008, and trying to make an array to control a bunch of picture boxes. I have plans to use this method of controlling the picture boxes using an array for a game DESIGN (Tetris for example). But I don't want any code for tetris or any game right now! My main and only priority that I can't figure out right now is declaring and using an array which I can store picture boxes in. I'm fairly new at C# and crossed over from java (school course instructed) and have a smaller background in Visual Basic. So I'm pretty new.
To create the array I use Code: [Select]int[] pictureBoxes = new int[4]; but then later when I try and declare the array as a picture box Code: [Select]pictureBoxes[0] = new PictureBox(); I get the error that pictureboxes cannot IMPLICITLY be converted to int.
Can anyone help me out? Possibly supply me with working code for Visual Studio 2008 C# that will create an array of pictureboxes so I can CHECK my code with it and see what I'm doing WRONG?Nevermind! I finally found what I'm doing wrong! In case anyone was wondering... What I should have done was: Code: [Select]PictureBox[] pictureBoxes = new PictureBox[4]and when actually creating a new PictureBox for that array place, I needed to put Code: [Select]pictureBoxes[0] = new PictureBox();Thanks anyways though =)
|