你查一查有关printer对象的属性,应该有这些属性的…!!!

解决方案 »

  1.   

    设基准点坐标为X,Y,打印字符串S
    右对齐  (X,Y)为最右点:
    Printer.CurrentX=X
    Printer.CurrentY=Y-Printer.TextWidth(S)
    Printer.Print S
    居中对齐  (X,Y)为中点:
    Printer.CurrentX=X
    Printer.CurrentY=Y-Printer.TextWidth(S)/2
    Printer.Print S
      

  2.   

    dim TxtWidth as IntegerTxtWidth = Printer.TextWidth(title)
    Printer.CurrentX = (Printer.Width - TxtWidth) \ 2
    Printer.Print title以上是行居中算法,列居中楼上写过了
    右对齐,差不多一样,自己写吧
      

  3.   

    用OrchidPrinter
    http://www.csdn.net/cnshare/soft/12/12442.shtm
      

  4.   

    why not use vsflexgrid & vsview?
      

  5.   

    use DrawText or DrawTextEx Can do best
      

  6.   

    对狙击组长所说的“不用这么复杂,用“,”和“;”就行了”表示怀疑。那样好象不能使居中对齐,只是与上次输出的位置有了些关联。
    要居中对齐必须做到:1、知道纸张的宽度,2、知道要输出的字符串的长度,3、设置printer的currentx属性。
    katanacool的源代码就做到了以上几点,是比较好用的。
      

  7.   

    除非左对齐,都要用TextWidth计算宽度