怎样在Combobox1加上所有系统打印机,并且使当前combobox1.itemindex为系统默认打印机?
解决方案 »
- 问个小问题,以下三种写法哪种比较好?free,freeandnil,cafree...
- 想在系统中集成word的编辑环境,怎么做到?大侠都来看看啊
- 请问SPCOMM中串口的6和7脚短接时会触发什么变化?串口的6和7脚短接时会触发什么变化?
- 如何使用触发器实现当一个表中的某一字段的值改变,该字段与其具有相同属性的值随之改变?
- 关于端口监听的问题(在线等)
- 请人把下面的VC代码翻译为DELPHI代码!
- 一個關於Delphi針對SQL常見問題 還望各位大俠指教!!!!!
- 关于Soket接受数据的问题,请高手看过来
- 请问能否帮忙提供限时特定程序的时长,谢谢大家
- 熟悉spread控件的兄弟姐妹们进来瞧瞧,只能给到一百分了。
- Richviewedit保存自定义的文件后缀名????
- 求Delphi 5 所有补丁 加急! 加急! 加急! 加急!
procedure TForm1.Button3Click(Sender: TObject);
var
i: integer;
begin
for i:=0 to printer.Printers.Count-1 do
begin
combobox1.Items.Add(printer.Printers.Strings[i]);
end;
combobox1.ItemIndex:= printer.PrinterIndex;
end;
Specifies which printer listed in the Printers property is the currently selected printer.Delphi syntax:property PrinterIndex: Integer;
procedure TForm1.xxx ;
var
i: integer;
begin
combobox1.clear;
for i:=0 to printer.Printers.Count-1 do
begin
combobox1.Items.Add(printer.Printers.Strings[i]);
end;
combobox1.ItemIndex:= printer.PrinterIndex;
end;
var
i: integer;
printer: Tprinter;
begin
combobox1.Clear;
printer:=Tprinter.Create;
for i:=0 to printer.Printers.Count-1 do
begin
combobox1.Items.Add(printer.Printers.Strings[i]);
end;
combobox1.ItemIndex:= printer.PrinterIndex;
printer.Free;
end;