Einzelnen Beitrag anzeigen

Benutzerbild von stahli
stahli

Registriert seit: 26. Nov 2003
Ort: Halle/Saale
4.337 Beiträge
 
Delphi 11 Alexandria
 
#24

AW: Repaint beim Form-Resize beschränken

  Alt 27. Nov 2011, 12:02
Mit embedded Forms würde es wohl funktionieren:
Delphi-Quellcode:
    FormXyz.ManualDock(TabSheetXyz, nil, alNone);
    FormXyz.Align := alClient;
    FormXyz.Show;

(Im Beispiel setze ich das Formular übrigens in ein TabSheet und da flackern die Controls auch beim Resizen - ebenso wie GroupBoxen.
Ich nutze hier embedded Forms aus Gründen der Übersichtlichkeit und Projektaufteilung.)


Embedded Forms in TabControls flackern widerum nicht. Allerdings muss man dann dynamisch beim umblättern das passende Form einblenden.
Das habe ich so getan:
Delphi-Quellcode:
procedure TFormPlan.odTabControlTournamentsPlanShowRegister(Sender: TObject);

  procedure ShowForm(F: TForm);

    procedure DoShowForm(SF, F: TForm; FC: TodFormCtrl);
    begin
      if SF = F then
      begin
        if (SF.Parent <> PanelTournamentsPlan) or (not SF.Visible) then
        begin
          SF.ManualDock(PanelTournamentsPlan, nil, alNone);
          SF.Align := alClient;
          SF.Show;
        end;
        FC.od := odTabControlTournamentsPlan.ActiveOd;
        if Assigned(SF.OnShow) then
          SF.OnShow(Self);
      end
      else
      begin
        FC.od := nil;
        SF.Close;
      end;
    end;

  begin
    CourtTournament := odTabControlTournamentsPlan.ActiveOd as TodTournament;
    DoShowForm(FormPlanMelee, F, FormPlanMelee.odFormCtrl);
    DoShowForm(FormPlanSwiss, F, FormPlanSwiss.odFormCtrl);
    DoShowForm(FormPlanGroup, F, FormPlanGroup.odFormCtrl);
    DoShowForm(FormPlanKo, F, FormPlanKo.odFormCtrl);
  end;

begin
  if odTournament = nil then
    ComboBoxTournamentSystem.ItemIndex := -1
  else if odTournament.Data_Is_Melee then
    ComboBoxTournamentSystem.ItemIndex := 0
  else if odTournament.Data_Is_Swiss then
    ComboBoxTournamentSystem.ItemIndex := 1
  else if odTournament.Data_Is_Group then
    ComboBoxTournamentSystem.ItemIndex := 2
  else if odTournament.Data_Is_Ko then
    ComboBoxTournamentSystem.ItemIndex := 3
  else
    ComboBoxTournamentSystem.ItemIndex := -1;
  case ComboBoxTournamentSystem.ItemIndex of
    0:
      ShowForm(FormPlanMelee);
    1:
      ShowForm(FormPlanSwiss);
    2:
      ShowForm(FormPlanGroup);
    3:
      ShowForm(FormPlanKo);
  else
    ShowForm(nil);
  end;
  ComboBoxTournamentSystem.Enabled := ComboBoxTournamentSystem.Text = '';
end;
Stahli
http://www.StahliSoft.de
---
"Jetzt muss ich seh´n, dass ich kein Denkfehler mach...!?" Dittsche (2004)

Geändert von stahli (27. Nov 2011 um 12:05 Uhr)
  Mit Zitat antworten Zitat