我想用一个程序修改打印机设置后,永久的修改打印设置,而不是动态修改后,程序关闭后又恢复原来的。(过程中不能弹出系统打印设置对话框)
解决方案 »
- Delphi中有办法静态设置控件ID号吗?或则让控件ID号不会每次运行都改变也可以
- 怎么获得一个数据库的记录数啊?
- 如何知道ftp文件传输是否完成
- combobox的那个下键头如何才透明(即与表单背景色一致
- 关于函数的两个难题,高手指点。
- 请问怎样用Delphi程序取到Excel实际的最大行数和最大列数?
- 这段程序错在哪?
- 市面为什么没有专门讲c/s模式数据库开发的书? 不知有什么好的资料?
- 招聘全职程序员,北京通州
- delphi7中的ADO控件属性connection设置保存完后,每次重新打开又被清空!
- 求购 p2c windows版!!!!!!!!
- ===============又来广告了,想拿分的up=========
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs,StdCtrls, ComCtrls, ExtCtrls,printers;type
TForm1 = class(TForm)
PrinterSetupDialog1: TPrinterSetupDialog;
Button1: TButton;
ComboBox1: TComboBox;
Label1: TLabel;
Label2: TLabel;
RadioGroup1: TRadioGroup;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
begin
printer.PrinterIndex:=combobox1.ItemIndex;
formcreate(self);
end;procedure TForm1.Button2Click(Sender: TObject);
begin
printer.BeginDoc;
printer.Canvas.TextOut(10,20,'hello'+label1.Caption);
printer.EndDoc;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
with combobox1 do
begin
Clear;
items.Assign(printer.Printers);
itemindex:=printer.PrinterIndex;
end;
label1.Caption:=printer.printers[printer.printerindex];
label2.Caption:='Width: '+Inttostr(printer.pageWidth)
label2.Caption:=label2.Caption+' Height: '+inttostr(Printer.PageHeight);
case printer.Orientation of
PoPortrait:RadioGroup1.ItemIndex:=0;
PoLandscape: RadioGroup1.ItemIndex:=1;
end;
end;end.