編寫一個Delphi打印程序,檢測系統中安裝的所有打印機,枚舉出這些打印機,代碼非常簡單,下面發給大家:
01
unit
Unit1;
02
interface
03
04
uses
05
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
06
Dialogs, StdCtrls,Printers, XPMan;
07
08
type
09
TForm1 =
class
(TForm)
10
Button1: TButton;
11
GroupBox1: TGroupBox;
12
Memo1: TMemo;
13
Button2: TButton;
14
procedure
Button1Click(Sender: TObject);
15
Button2Click(Sender: TObject);
16
private
17
{ Private declarations }
18
public
19
{ Public declarations }
20
end
;
21
22
var
23
Form1: TForm1;
24
25
implementation
26
27
{$R *.dfm}
28
29
TForm1
.
30
begin
31
Memo1
Clear;
32
memo1
Lines
Assign(Printer
Printers);
33
if
trim(memo1
Text) =
''
then
34
35
showmessage(
'沒有安裝打印機!'
);
36
37
38
39
40
41
Close;
42
43
44
本例效果圖:代碼文件:unit Unit1;i
建立數據庫的代碼:{建立內存數據庫的一般代碼:
Delphi提供了開放的API,是程序員可以增強Delph
Delphi 10 Seattle Update 1 修復
Delphi實現乒乓球小游戲:在游戲編寫思路方面,主要分為