[Mono-list] An array of SWF icons

Paul F. Johnson paul at all-the-johnsons.co.uk
Mon Mar 6 10:57:45 EST 2006


Hi,

I'm not sure how to do this, so I'm a' askin'

I'm trying to create an array of TextBox icons. All of the text boxes
have the same properties, so creating them as an array makes sense (it
also means I can error handle easier).

Currently, the code looks like this

private TextBox IP[4];

...

for (int i = 0; i < 4; ++i)
{
  this.IP[i] = new TextBox();
  this.IP[i].Size = new Size(60, 10);
  // and so on
}

this.IP.AddRange(new Control[] {this.IP[0], this.IP[1], this.IP[2], 
                                this.IP[3]});

However, this fails to compile. I've followed the suggestion of adding
fixed before TextBox, but that then complains 

list4.cs (16, 25): error CS1642: `testwindow.IP': Fixed size buffer
fields may only be members of structs

Is there a simple way around this?

TTFN

Paul
-- 
"Logic, my dear Zoe, is merely the ability to be wrong with authority" -
Dr Who



More information about the Mono-list mailing list