*bump*
I just need to know how to add picBlocks[j] as a class member. If you need additional code accurately anser this question, I'd be glad to post it.
Thanks
Type: Posts; User: tineras
*bump*
I just need to know how to add picBlocks[j] as a class member. If you need additional code accurately anser this question, I'd be glad to post it.
Thanks
I would prefer to make it a class member, but I'm not sure how to do that. I'm still learning and my teacher doesn't help us out very much.
I created an object array when a button is clicked. When I try to use any of the objects in another function, it is saying that it's an undeclared identifier.
What do I need to do to make sure I...
I do appreciate the help. I have one other question. When I try to use it in another function, it is saying that it's an undeclared identifier.
Do I need to reference the function or make it...
Amazing!! That works perfectly. Thank you so much. My teacher has been really lazy and doesn't seem to want to help us out. So, I have to figure this stuff out myself. This is all I needed to...
I'm using Visual C++ .NET to create a Windows Forms Application.
Are there any good VC++ forums that you can recommend. I don't normally frequent programming forums (as you can see by my whopping 12 posts)?
The code I originally posted was something my professor gave to us and later said, "Oh, this doesn't work". So, I don't even have to use that. I can start from scratch with the whole array thing. ...
When I put this code in:
PictureBox* picBlocks = new PictureBox[5];
for(int i = 0; i < 5; i++)
pnlGameField->Controls->Add(picBlocks[i]);
I get a bunch of errors:...
I tried this and it does work. However, I am still unable to use these items in other functions in my code. I really need to be able to reference them individually without having to jump through a...
That seems to be running without any problems also, but I'm not sure what each of these new PictureBoxes are being called. I don't know how reference them in my code...
like:
...
for(int i = 0; i < 5; i++)
pnlGameField->Controls->Add(new PictureBox() );
This seems to work without error, but I just don't know how to access the new PictureBoxes that are created.
Like...
When I add [5] instead of [], I get the error at this line:
PictureBox* picBlocks[];
error C3616: '5': a size cannot be specified in a __gc array declaration
and
at this line:
Are you saying that this should be my only line of code:
for(int i = 0; i < 5; i++)
pnlGameField->Controls->Add(new PictureBox() );
I need each new PictureBox to be named...
I need to create an array of objects when I click a button in Visual C++. I am having some difficulty doing so. Any help would be appreciated.
---Code within button click---
PictureBox*...
Luckily I already had that in my code. If I didn't, I would've been stumped. Thanks again!
Thanks a million. Worked like a charm!
I need to draw 8 random numbers (from 1 to 4). The numbers can only repeat once. I need there to be two 1s, two 2s, two 3s, and two 4s in random order. I need them put into an array.
Example...