系统中装有多台打印机如何在用quickrep做报表时根据情况选择想要得打印机?
解决方案 »
- delphi 二维动态数组的问题
- 怎样在delphi IDE上面显示当前项目的路径?
- 请问:在panel上画image后遮住了panel的caption显示,可不可以把image放到panel底下呢?
- oracle 8和delphi 6,查询前五条记录时出错:请看正文,谢谢!
- 如何让一个实数只显示以为小数??急等
- 国防科大版第一次亲密接触(完整版)
- CDSoftwareWj给ihihonline捐献了382可用分;ihihonline收到了:343可用分
- 怎样做个时钟,可以设定它的时间初值,以后可根据需要调整?
- 如何解除Kylix3的三十天限制
- 提议:哪位能把《Delphi 5开发人员指南》的配套光盘内容传到网站供大家下载?另外...
- 如何将DBGRID数据保存到EXCEL文件中?
- 改变窗体大小程序怎么自动退出?
哈哈,这样比较麻烦,但也是一种方法
我没用过QUICKREP,胡诌的
var
Device: array[0..255] of Char;
Driver: array[0..255] of char;
Port: array[0..255] of char;
s : array[0..255] of Char;
hDeviceMode: THandle;begin
//messagebeep(2);
beep();
Printer.PrinterIndex := ComboBox1.ItemIndex;
Printer.GetPrinter (Device, Driver, Port, hDeviceMode);
StrCopy (s, Device);
StrCat (s, ',');
StrCat (s, Driver);
StrCat (s, ',');
StrCat (s, Port);
WriteProfileString ('windows', 'device', s);
StrCopy (s, 'windows');
SendMessage (HWND_BROADCAST, WM_WININICHANGE, 0, LongInt(@s));
ComboBox1.Items := Printer.Printers; {populates ComboBox}
ComboBox1.ItemIndex := Printer.PrinterIndex;
end;procedure TForm1.ComboBox1Change(Sender: TObject);
var
Device: array[0..255] of Char;
Driver: array[0..255] of char;
Port: array[0..255] of char;
s : array[0..255] of Char;
hDeviceMode: THandle;begin Printer.PrinterIndex := ComboBox1.ItemIndex;
Printer.GetPrinter (Device, Driver, Port, hDeviceMode);
StrCopy (s, Device);
StrCat (s, ',');
StrCat (s, Driver);
StrCat (s, ',');
StrCat (s, Port);
WriteProfileString ('windows', 'device', s);
StrCopy (s, 'windows');
SendMessage (HWND_BROADCAST, WM_WININICHANGE, 0, LongInt(@s));
end;
以上为改变默认打印机代码
察看帮助如下:
QuickRep1.QrPrinter.PrinterIndex:=-1;//默认打印机;
但是就是这一句总是出地址错误,不知道什魔原因