Autor Beitrag
Leuchtturm
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Di 11.09.07 16:07 
Hi,
ich versuche gerade 25 Labels aus einem Array zu erstellen:
ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
Label[] labels = new Label[25];
for (int i = 0; i < 24; i++)
{
   labels[i] = new Label();
   labels[i].Size = new Size(i * 3 , i * 3);
   labels[i].Name = "label" + i.ToString();
   labels[i].Text = "Moin" + i.ToString();
   labels[i].BackColor = Color.Black;
   labels[i].Show();
}

So funktioniert nicht! :?
Was mache ich falsch. Mir reicht auch ein Stichwort oder ein Hinweis.
Leuchtturm
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Di 11.09.07 16:10 
Egal ob in Delphi oder C#, die Leute sagen den armen Komponenten nie, wo sie sich überhaupt zeigen sollen ;-)

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Di 11.09.07 16:29 
user profile iconChristian S. hat folgendes geschrieben:
Egal ob in Delphi oder C#, die Leute sagen den armen Komponenten nie, wo sie sich überhaupt zeigen sollen ;-)

:oops:
Ich bin anscheinend etwas beschränkt :shock:
Ich schaffe es einfach nicht:
ausblenden C#-Quelltext
1:
labels[i].Location  =  new Point(i * 3, i * 3);					

Geht nicht :bawling:
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Di 11.09.07 16:33 
Ich meinte eigentlich, dass Du der Komponente sagen sollst, worauf sie sich zeigen soll, was also der Parent sein soll.

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Di 11.09.07 16:35 
Vielen Dank :zustimm:
Ich bin wirklich beschränkt :shock: