?? printsetup.~pas
字號:
//打印設置
unit PrintSetup;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
TPrintSetupForm = class(TForm)
Label1: TLabel;
edTitle: TEdit;
FontDialog: TFontDialog;
btTitleFont: TBitBtn;
Label2: TLabel;
btContent: TBitBtn;
PrintPreview: TBitBtn;
procedure PrintPreviewClick(Sender: TObject);
procedure btTitleFontClick(Sender: TObject);
procedure btContentClick(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
TitleFont : TFont;
ContentFont :TFont;
PrintTitle : String;
end;
var
PrintSetupForm: TPrintSetupForm;
implementation
uses PrintMain,ArchMain, printMemo;
{$R *.dfm}
procedure TPrintSetupForm.PrintPreviewClick(Sender: TObject);
begin
PrintTitle :='';//保存打印的標題信息
PrintTitle :=edTitle.Text;
/////////////////////////////////////////////////////////
//判斷是打印查詢的多條記錄,還是打印單條記錄的詳細信息
/////////////////////////////////////////////////////////
if StuffMain.PageControl1.ActivePageIndex <>1 then
begin
PrintMemoForm :=TPrintMemoForm.Create(Application);
PrintMemoForm.Show;
printMemoForm.Close;
end
else
begin
PrintMainForm :=TPrintMainForm.Create(Application);
PrintMainForm.Show;
PrintMainForm.close;
end;
PrintSetupForm.Close;
end;
procedure TPrintSetupForm.btTitleFontClick(Sender: TObject);
begin
//設置標題的字體
if FontDialog.Execute then
TitleFont :=fontDialog.Font;
end;
procedure TPrintSetupForm.btContentClick(Sender: TObject);
begin
//設置正文的字體
if FontDialog.Execute then
ContentFont :=fontDialog.Font;
end;
procedure TPrintSetupForm.FormShow(Sender: TObject);
begin
//創建字體類型變量,并為它們賦初值
TitleFont :=TFont.Create;
ContentFont :=TFont.Create;
TitleFont :=PrintSetupForm.Font;
ContentFont :=PrintSetupForm.Font;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -