Articles   Members Online: 3
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to print from a TListView Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
Print from a TListView 19-Sep-04
Category
Reporting /Printing
Language
Delphi 2.x
Views
313
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
Darley, F. Joe
Reference URL:
			1   unit Unit1;
2   
3   interface
4   
5   uses
6     Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7     Dialogs, StdCtrls, ComCtrls, ExtCtrls;
8   
9   type
10    TForm1 = class(TForm)
11      Button1: TButton;
12      ListView1: TListView;
13      Image1: TImage;
14      procedure Button1Click(Sender: TObject);
15    private
16      { Private declarations }
17    public
18      { Public declarations }
19    end;
20  
21  var
22    Form1: TForm1;
23  
24  implementation
25  
26  {$R *.dfm}
27  
28  procedure TForm1.Button1Click(Sender: TObject);
29  var
30    bmp: TBitmap;
31  begin
32    bmp := Tbitmap.Create;
33    try
34      bmp.width := listview1.width;
35      bmp.height := listview1.height;
36      with bmp.canvas do
37      begin
38        Lock;
39        try
40          listview1.perform(WM_PRINT, handle, PRF_CHILDREN or PRF_CLIENT or
41            PRF_NONCLIENT or PRF_ERASEBKGND);
42        finally
43          Unlock
44        end;
45        image1.picture.bitmap := bmp;
46      end;
47    finally
48      bmp.free
49    end;
50  end;
51  
52  end.


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC