R
R
Hi.
I need to generate a bunch (100) of lables to use in my application.
I'm sure there is a smarter way, than using the designer in VS...
Can some one fill in the missing part?
(having a private System.Windows.Forms.Label foo
[in constructor]
this.foo = new System.Windows.Forms.Label();
InitializeComponent();
for (int i=0;i<9;i++)
{
for (int j=1;j<=10;j++)
{
labelnumber = i*10+j;
this.foo.Location = new System.Drawing.Point(8+i*16, 8+(j-1)*12);
this.foo.Text = labelnumber.ToString();
this.foo.ForeColor = System.Drawing.Color.White;
this.pNumbers.Controls.Add(this.foo);
}
}
pNumbers is a panel.
Obviously I overwrite the already created labels. How can I avoid that? By
using an array? How?
Suggestions for solutions are highly appreciated!
Thanks in advance,
R
--
Due to heavy (20,000+/week!!) spam reception, I use a fake email.
Please reply in this group, which would help others as well.
Help fight spam:
NEVER reply to spam
NEVER buy anything from spamers
NEVER unsubscribe from a spam-list
I need to generate a bunch (100) of lables to use in my application.
I'm sure there is a smarter way, than using the designer in VS...
Can some one fill in the missing part?
(having a private System.Windows.Forms.Label foo

[in constructor]
this.foo = new System.Windows.Forms.Label();
InitializeComponent();
for (int i=0;i<9;i++)
{
for (int j=1;j<=10;j++)
{
labelnumber = i*10+j;
this.foo.Location = new System.Drawing.Point(8+i*16, 8+(j-1)*12);
this.foo.Text = labelnumber.ToString();
this.foo.ForeColor = System.Drawing.Color.White;
this.pNumbers.Controls.Add(this.foo);
}
}
pNumbers is a panel.
Obviously I overwrite the already created labels. How can I avoid that? By
using an array? How?
Suggestions for solutions are highly appreciated!
Thanks in advance,
R
--
Due to heavy (20,000+/week!!) spam reception, I use a fake email.
Please reply in this group, which would help others as well.
Help fight spam:
NEVER reply to spam
NEVER buy anything from spamers
NEVER unsubscribe from a spam-list