Original Post
hi there,
im having problems on making an array of buttons:
i have the following class:
__gc class foo : public Form{
private:
Button *scope[];
...
//constructor:
foo::foo{
this->scope = new Button *[300];
for( int i = 0; i < 300; i++ ){
this->scope->Location = System::Drawing:
oint( i, 200 );
this->scope[i]->Width = 1;
this->scope[i]->Height = 1;
this->scope[i]->BackColor = System::Drawing::Color::DarkRed;
this->Controls->Add( this->scope[i] );
}
}
this does compile but when running it it crashes and gives me the error: "System.NullReferenceException: object reference not set to an instance of an object".
is there anyway i can correct this?
thanks.
[edited by - a2ps on January 2, 2004 8:32:02 PM]