home *** CD-ROM | disk | FTP | other *** search
- unit Fdemo11;
-
- interface
-
- uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls, Buttons,
- StdCtrls, ExtCtrls, Printers, PrnWin, CB_Types, CB_MFunc;
-
- type
- TForm11 = class(TForm)
- CancelBtn: TBitBtn;
- Bevel1: TBevel;
- ListBox1: TListBox;
- preview: TBitBtn;
- PrintWin1: TPrintWin;
- Panel1: TPanel;
- Label2: TLabel;
- Shape1: TShape;
- procedure previewClick(Sender: TObject);
- procedure FormActivate(Sender: TObject);
- private
- { Private declarations }
- public
- end;
-
- var
- Form11: TForm11;
-
- implementation
-
- {$R *.DFM}
-
-
- procedure TForm11.previewClick(Sender: TObject);
- var
- i: Integer;
- y: Real;
- begin
- PrintWin1.BeginPrint;
- PrintWin1.NewFont ('Arial', 20, True, True, True);
- PrintWin1.DrawWindow (1,poCenter, Panel1);
-
- y := 2.0;
- for i := 1 to ListBox1.Items.Count-1 do begin
- PrintWin1.NewFont (ListBox1.Items[i], 16, False, False, False);
- PrintWin1.Drawtext( y,poLeft, ListBox1.Items[i]);
- PrintWin1.Drawtext( y,poCenter, ListBox1.Items[i]);
- PrintWin1.Drawtext( y,poRight, ListBox1.Items[i]);
- y := y+0.2;
- if y > PrintWin1.PageHeight-1 then begin
- PrintWin1.NewPage;
- y := 2.0;
- end;
- end;
- PrintWin1.EndPrint;
- end;
-
- procedure TForm11.FormActivate(Sender: TObject);
- begin
- ListBox1.Items := Printer.Fonts;
- end;
-
- end.
-