PDA

View Full Version : Visual C++ 2005 Help


TeslaRecoil
12-06-2006, 06:54 PM
I'v been searching for an answer to this on developer forums, but I'm not having much luck. I thought some of our resident technical gurus might be able to help.

I'm using Visual C++ 2005 (not by choice) for a project at work. I'm trying to create an array of controls (specifically, an array of Panel controls). I've been able to do this in various versions of VB, but I know it's a little different for VC++ 2005.

Basically, I have the following:


System::Windows::Forms::GroupBox::ControlCollectio n^ myGroupBox = this->groupBox12->Controls;

System::Windows::Forms::Panel::Control^ thisPanel;


I'm using this code to be able to cycle through all panels in a group box, so I can dynamically build my array.

The problem is, I can't simply declare an array of type System::Windows::Forms::Panel::Control. The compiler choked on that.

I tried the following:


array<System::Windows::Forms::Panel::Control^> ^PanelArray;


This was acceptable to the compiler, but I was not able to create an instance of this array, or at least not one that I could assign controls to.

I figured I'd do some research before wasting any more time on this.

Any ideas?

TeslaRecoil
12-06-2006, 10:38 PM
Nevermind. I figured it out.