别晕
我就来画一个
//定位打印头
x=30;
y=20;
Printer()->begin
Doc();//开始一个打印工作
//打印标头
Printer()->Canvas->Font->Size=8;
Printer()->Canvas->Font->Name="黑体";
Printer()->Canvas->TextOut(x,y," ----位置详单----");
Printer()->Canvas->Font->Size=7;
Printer()->Canvas->Font->Name="宋体";
//打印表格标题行
y=y+80;
Printer()->Canvas->TextOut(x,y,"┏━━━━━━━━━┳━━━━━━━━━━━━┓");
y=y+80;
Printer()->Canvas->TextOut(x,y,"┃ 名称: ┃");
y=y+80;
for(int i=0;i<dprintlist->Count;i++)
{
printitem=dprintlist->Items->operator [](i);
bn=printitem.SubString(0,printitem.LastDelimiter("::")-2);
loc=printitem.SubString(printitem.LastDelimiter("::"),printitem.Length());
doPreint(bn);
Printer()->Canvas->TextOut(x,y,"┃存放位置: ┃");
y=y+80;
doPreint(loc);
}
Printer()->Canvas->TextOut(x,y,"┗━━━━━━━━━┻━━━━━━━━━━━━┛");
Printer()->EndDoc();//结束一个打印工作
//ShowMessage("打印完成!谢谢使用!");
Application->MessageBoxA("打印完成!谢谢使用!","系统",MB_OK);
}
catch(...)
{
//ShowMessage("打印出错!请检查打印机是否连接好或者电源是否打开及其设置!");
Application->MessageBoxA("打印出错!请检查打印机是否连接好或者电源是否打开及其设置!","图书查询系统",MB_OK);
} }