Autor Beitrag
BennyM
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Do 13.11.03 11:09 
Hallo,

wenn ich mich in der Vorschau des Quickreports befinde kann ich ja mit dem obigen Button die Vorschau ausdrucken ! Kann ich diesen Button irgendwie abfragen ? Da ich verhindern möchte das aus der Vorschau gedruckt werden kann.
CenBells
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1547

Win 7
Delphi XE5 Pro
BeitragVerfasst: Do 13.11.03 12:52 
Hallo,

dazu benötigst du auf deinem Formular, auf dem der Quickreport liegt einen TTimer.

im OnTimer führst du folgenden code aus
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:
{var
   prevFrm : TForm;
   j,k:Integer;
   tBar, tBut: TComponent;  }

begin
  Timer1.Enabled := false;
  if not assigned(QuickRep.QRPrinter) then exit;


  Timer1.Enabled := false;
   // this code goes into the proc above
   // find the buttons and set them
   prevfrm := TForm( QuickRep.QRPrinter.Client.Parent);
   for j := 0 to prevfrm.controlcount-1 do
   begin
     tBar := prevfrm.controls[ j ];
     if tBar is TToolbar then begin
             // Vanish the toolbar !!
             // TToolbar(tBar).visible := false;
             // break; // if vanishing
       for k := 0 to TToolbar(tBar).controlcount-1 do begin
//         tBut := TToolbar(tBar).controls[ k ];
//         if tBut is TToolbutton then  // could test the name here
//           TToolbutton(tBut).enabled := false;
       end;
    end;
  end; 
end;


Gruß
Ken

_________________
Eine Klasse beschreibt die Struktur und das Verhalten einer Menge gleichartiger Objekte.