Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ListBox Print 1

Status
Not open for further replies.

dredfern

Technical User
Dec 7, 2003
14
GB
Is it possible to print out the contents of a ListBox
 
var
Line: Integer;
PrintText: TextFile; {declares a file variable}
begin
AssignPrn(PrintText); {assigns PrintText to the printer}
Rewrite(PrintText); {creates and opens the output file}
Printer.Canvas.Font := Memo1.Font; {assigns Font settings to the canvas}
for Line := 0 to Listbox1.Items.Count - 1 do
Writeln(PrintText, Listbox1.Items[Line]); {writes the contents of the listbox to the printer object}
CloseFile(PrintText); {Closes the printer variable}
end;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top