Einzelnen Beitrag anzeigen

nahpets
(Gast)

n/a Beiträge
 
#9

AW: Verhindern, daß ein Fenster den Fokus bekommt

  Alt 13. Sep 2017, 12:42
Wenn Du in Deinem Hauptformular eine Ereignisroutine für OnShow schreibst, die Du dem OnShow-Ereignis des Druckvorschauformulares nach dessen Erstellung zuweist, könntest Du es in der Ereignisroutine mal mit sowas probieren:
Delphi-Quellcode:
procedure THauptFormular.FormShowFuerDeinDruckvorschauFormular(Sender: TObject);
begin
  // Oder eine andere Positions- und/oder Größenberechnung zum Zentrieren ... auf dem Monitor.
  DeinDruckvorschauFormular.Left := Screen.Monitors[Hauptformular.Monitor.MonitorNum].Left;
  DeinDruckvorschauFormular.Width := Screen.Monitors[Hauptformular.Monitor.MonitorNum].Width;
  DeinDruckvorschauFormular.Top := Screen.Monitors[Hauptformular.Monitor.MonitorNum].Top;
  DeinDruckvorschauFormular.Height := Screen.Monitors[Hauptformular.Monitor.MonitorNum].Height;
  // Eventuell ginge auch sowas:
  DeinDruckvorschauFormular.Left := Hauptformular.Left + 4;
  DeinDruckvorschauFormular.Width := Hauptformular.Width - 8;
  DeinDruckvorschauFormular.Top := Hauptformular.Top + 8;
  DeinDruckvorschauFormular.Height := Hauptformular.Height - 16;
end;
Ist allerdings nur geraten, nie ausprobiert.
  Mit Zitat antworten Zitat