Autor Beitrag
chrissivo
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 130

WIN XP, WIN 2000, WIN MCE, WIN 98
D5 Pers
BeitragVerfasst: So 26.06.05 12:08 
Hallo,
ich weiß, dass dieses Thema eigentlich schon oft aufkam, doch irgendwie konnte ich mein Problem nicht selbst lösen. Ich möchte also zur Laufzeit mehrere CheckBoxen erzeugen lassen. Erzeugt werden Sie zur Laufzeit wohl auch, aber sehen kann ich sie nicht.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
var
  Form47: TForm47;
  auswahlbox : Array[1..10] of TCheckBox;
...
procedure TForm47.FormCreate(Sender: TObject);
var
   ft,
   i          : Integer;
begin
    for ft := 1 to 10
     do begin
             auswahlbox[ft] := TCheckBox.Create(self);
             with auswahlbox[ft] do
             begin
                  Parent := GroupBox1;
                  Caption := IntToStr(ft);
                  Inc(i);
                  Visible := True;
                  Show;
                  Repaint;
                  if (i mod 2) = 0
                  then Left  := 144
                  else Left := 8;
                  if (i mod 2) = 0
                  then Top := 16*i div 2
                  else Top := 16*(i+1) div 2;
             end;
     end;
end;


Der eigentliche Programmtext sieht ein wenig anders aus, deshalb auch zwei Integer-Variablen. "ft" ist sonst eine Variable von einem selbstdefiniertem Datentypen, ist hier aber nicht das Problem.
Alternativ habe ich als Parent Form47 zugewiesen. Hat aber auch nicht funktioniert.
Für jede Hilfe bin ich dankbar

Chrissi

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
chrissivo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 130

WIN XP, WIN 2000, WIN MCE, WIN 98
D5 Pers
BeitragVerfasst: So 26.06.05 13:15 
tja, vielleicht hätte ich i mal initialisieren sollen. Dachte, das ist immer 0, wenns erstellt wird.
*autsch* tut das weh!
Jetzt funktionierts!