Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Printing from listbox

Posted on 1999-07-30
8
Medium Priority
?
167 Views
Last Modified: 2010-04-04
I have a list in a listbox that I need to print out. Is there a way to do this?

Thanks

JohnE
0
Comment
Question by:JohnE
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 400 total points
ID: 1392122
hi,
try this:

uses Printers


procedure TForm1.Button1Click(Sender: TObject);
var
i : integer;
begin
 Printer.BeginDoc;
  for i := 0 to ListBox1.Items.Count -1 do
  begin
   Printer.Canvas.Font.Name := ListBox.Items[i];
   Printer.Canvas.TextOut(100,100 + i * 12, ListBox1.Items[i]);         end;
   Printer.EndDoc;
end;

Regards Barry

0
 
LVL 17

Expert Comment

by:inthe
ID: 1392123
you dont need this line its for if the listbox contained a list of fonts..

Printer.Canvas.Font.Name := ListBox.Items[i];
   
0
 

Author Comment

by:JohnE
ID: 1392124
Barry,

Thanks for the suggested answer. It does work, in looking at the results and evaluating my needs, how can I transfer the listox items to a memo, so that I can then include it in a Qreport. I have tried but I only succeed in transfering the first item.

Thanks

John
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:JohnE
ID: 1392125
Barry,

Thanks for the suggested answer. It does work, in looking at the results and evaluating my needs, how can I transfer the listox items to a memo, so that I can then include it in a Qreport. I have tried but I only succeed in transfering the first item.

Thanks

John
0
 
LVL 17

Expert Comment

by:inthe
ID: 1392126
hi,
try this:

procedure TForm1.Button1Click(Sender: TObject);
 begin
  memo1.Clear;
  memo1.lines:=listbox1.items;
 end;

 :o)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1392127
hi all,

would it not better to do it with
memo1.lines.assign(listbox1.items);
?

meikl

0
 
LVL 17

Expert Comment

by:inthe
ID: 1392128
or that'd work too :-)
0
 
LVL 17

Expert Comment

by:inthe
ID: 1392129
or that'd work too :-)
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question