I have a component panel1 consisting of a list of type TListView and few labels. Now I want to print everything on that panel using printdialog. How to do this?
Quoted directly from the Delphi 5 help file example for the "Printer" function:
This example uses a button and a memo on a form. When the user clicks the button, the content of the memo is printed, with a 200-pixel border around the page. To run this example successfully, you must add the Printers unit to the uses clause of your unit.
procedure TForm1.Button1Click(Sender: TObject);
begin
with Printer do
begin
BeginDoc;
Canvas.TextRect(Rect(200,200,PageWidth-200,
PageHeight-200),200, 200, Memo1.Lines.Text);
EndDoc;
end;
end;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.