Sooo schwierig ist es eigentlich nicht.
So binde ich 3 Formulare in TabSheets ein:
Delphi-Quellcode:
FormGeneral.ManualDock(TabSheetGeneral, nil, alNone);
FormGeneral.Align := alClient;
FormGeneral.Show;
FormCompetitors.ManualDock(TabSheetCompetitors, nil, alNone);
FormCompetitors.Align := alClient;
FormCompetitors.Show;
FormPlan.ManualDock(TabSheetTournamentPlan, nil, alNone);
FormPlan.Align := alClient;
FormPlan.Show;
So zeige ich existierende Formulare dynamisch in einem TabControl an (wobei das TodFormCtrl eine eigene Komponente ist, die das Formular ggf. "steuert"):
Delphi-Quellcode:
procedure TFormSetting.odTabControlTournamentsSettingShowRegister(Sender: TObject);
procedure ShowForm(F: TForm);
procedure DoShowForm(SF, F: TForm; FC: TodFormCtrl);
begin
if SF = F then
begin
SF.ManualDock(odTabControlTournamentsSetting, nil, alNone);
SF.Align := alClient;
SF.Show;
FC.od := odTabControlTournamentsSetting.ActiveOd;
if Assigned(SF.OnShow) then
SF.OnShow(Self);
end
else
begin
FC.od := nil;
SF.Close;
end;
end;
begin
MemberTournament := odTabControlTournamentsSetting.ActiveOd as TodTournament;
DoShowForm(FormSettingMelee, F, FormSettingMelee.odFormCtrl);
DoShowForm(FormSettingSwiss, F, FormSettingSwiss.odFormCtrl);
DoShowForm(FormSettingGroup, F, FormSettingGroup.odFormCtrl);
DoShowForm(FormSettingKo, F, FormSettingKo.odFormCtrl);
end;
begin
if odTournament = nil then
ShowForm(nil)
else if odTournament.Data_Is_Melee then
begin
FormSettingMelee.odMelee := odTournament.Melee;
ShowForm(FormSettingMelee);
end
else if odTournament.Data_Is_Swiss then
begin
ShowForm(FormSettingSwiss);
end
else if odTournament.Data_Is_Group then
begin
ShowForm(FormSettingGroup);
end
else if odTournament.Data_Is_Ko then
begin
ShowForm(FormSettingKo);
end
else
ShowForm(nil);
end;
Vielleicht hilft Dir das ja als Anregung...