怎样让 QRExpr 在显示时能自动折行啊,还有,打印完之后自动停止,就是控制走纸。
多谢了!!!

解决方案 »

  1.   

    QrExpr 的AutoSize=False,AutoStretch=True,WrapText=True,对非汉字实现折行,对于汉字
    可用QrMemo控件(需要结合Memo控件一起使用,不知大家还有什么好方法)。控制走纸,你需要自定义纸张,打印机会按照你自定义的纸张进行走纸的。
      

  2.   

    谢谢konhon(优华无限),控制走纸我不想设置纸张,因为那样很麻烦,用代码能控制吗?就象pb的数据窗口打印一样,有多少打多少,不打印空白,因为我用连续纸
      

  3.   

    用代码控制走纸有一点复杂。我找一段代码给你看看:在打印前调用以下函数 
    procedure SetPaperSize(X, Y: Integer); 
    // 这段代码绝对可用。单位是0.1mm 
    // A4时 Printer.Pagewidth:=1440; A5时 Printer.Pagewidth:=1049; 
    // B5时 Printer.Pagewidth:=1290; 16K时 Printer.Pagewidth:=1035; 
    // lq1600宽行打印机这个值宽度最大为42cm左右, 长度大约2m。 
    {Question: 
    How can I change the papersize of my print job? 
    Answer: 
    One way to change printer settings at the start 
    of a print job is to change the printer's devicemode 
    structure. 
    See: TDEVMODE in the Delphi 1.02 help file or DEVMODE 
    in the Delphi 2.01 help file for other settings you can 
    change (providing the print driver supports the change). 
    The following example, contains code to change the papersize and 
    the paper bin that is uses:} 
    var 
    Device: array[0..255] of char; 
    Driver: array[0..255] of char; 
    Port: array[0..255] of char; 
    hDMode: THandle; 
    PDMode: PDEVMODE; 
    begin 
    Printer.PrinterIndex := Printer.PrinterIndex; 
    Printer.GetPrinter(Device, Driver, Port, hDMode); 
    if hDMode <> 0 then 
    begin 
    pDMode := GlobalLock(hDMode); 
    if pDMode <> nil then 
    begin 
    if (x = 0) or (y = 0) then 
    begin 
    {Set to legal} 
    pDMode^.dmFields := pDMode^.dmFields or dm_PaperSize; 
    {pDMode^.dmPaperSize := DMPAPER_LEGAL; changed by wulianmin} 
    pDMode^.dmPaperSize := DMPAPER_FANFOLD_US; 
    end 
    else 
    begin 
    {Set to custom size} 
    pDMode^.dmFields := pDMode^.dmFields or 
    DM_PAPERSIZE or 
    DM_PAPERWIDTH or 
    DM_PAPERLENGTH; 
    pDMode^.dmPaperSize := DMPAPER_USER; 
    pDMode^.dmPaperWidth := x {SomeValueInTenthsOfAMillimeter}; 
    pDMode^.dmPaperLength := y {SomeValueInTenthsOfAMillimeter}; 
    end; 
    {Set the bin to use} 
    //pDMode^.dmFields := pDMode^.dmFields or DMBIN_MANUAL; 
    //pDMode^.dmDefaultSource := DMBIN_MANUAL; GlobalUnlock(hDMode); 
    end; 
    end; 
    Printer.PrinterIndex := Printer.PrinterIndex; 
    //以下开始打印 
    end;