Autor Beitrag
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Sa 29.07.06 11:07 
Hallo Leute !
Ich steh mal gerade wieder auf dem Schlauch Ich erzeuge zur Laufzeit TabSheets je nach Anzahl der Files.
Soweit klappt das ja ohne Probleme.
bsp. Zwei Files - TS0 &. TS1.
Nun zu meinem Problem wenn Ich noch ein TabSheet zufügen will kommt es zum fehler weil TS0 ja schon existiert wie krieg Ich das am besten gelöst das er dann mit TS2 weitermacht.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
procedure TForm1.Button1Click(Sender: TObject);
var
 i: Integer;
begin
 with OpenDialog1 do
    begin
      Options := [ofAllowMultiSelect, ofFileMustExist];
      if Execute then
     begin
       for i := 0 to Files.Count - 1 do
       with TTabSheet.Create(PageControl1) do
    begin
      PageControl := PageControl1;
      Name := 'TS' + IntTostr(i);
      Caption := (ExtractFileName(Files[i]));
    end;
  end;
end;
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Sa 29.07.06 11:46 
Wenn du den Namen auf '' setzt, hast du damit keine Probleme, wenn ichs richtig weiß, ist der Komponentenname als Standard auch '', weiß es aber grad net auswenig

_________________
Programmers never die, they just GOSUB without RETURN
Blackheart666 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Sa 29.07.06 11:51 
Danke alias5000 hab das jetzt so gelöst.
ausblenden Delphi-Quelltext
1:
Name := 'TS' + IntTostr(i+PageControl1.PageCount);					

Blackheart666

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)