本文整理自网络,侵删。
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleServer, BarTender_TLB;
type
TForm1 = class(TForm)
btApp1: TBTApplication;
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
with btApp1.Formats.Open('c:\test.btw', True, '') do //打开标签文件
begin
SetNamedSubStringValue('BarCode1', pchar(edit4.Text)); //设置值
SetNamedSubStringValue('Text1', pchar(edit2.Text));
SetNamedSubStringValue('Text2', pchar(edit1.Text));
SetNamedSubStringValue('Text3', pchar(edit3.Text));
SetNamedSubStringValue('Text4', pchar(edit4.Text));
PrintOut(False, False); //打印
// Close(btDoNotSaveChanges); //关闭不保存
end;
//btApp1.Quit(btDoNotSaveChanges); //退出
END;
end.
相关阅读 >>
Delphi实现win10下Delphi 10.3.1 inline hook 调试器法获取寄存器并修改
Delphi xe6 取得app自己的版本号(横跨4个平台)
Delphi xe5 android 调用手机震动(通过jobject测试是否支持震动)
Delphi -- gdi+ Delphi如何让 tgpimage 直接从流中加载图片
更多相关阅读请进入《Delphi》频道 >>