| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 618 人关注过本帖
标题:请教printer问题
只看楼主 加入收藏
shinni
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-5-7
收藏
 问题点数:0 回复次数:1 
请教printer问题

printer问题


经调试printer.currnetX,currnentY的值都是正确的,可打印出来却不对,不知问题所在,有谁发现了,请指教一下

Dim a() As String
Dim str As String '定义一个数组存储一个段落的字符
Dim i, z, x, k, p As Long

Printer.ScaleWidth = 210
Printer.ScaleHeight = 297
x = 194
a = Split(Form2.Text1.Text, Chr(13)) '将TEXT文本以段为单位付给字符串数组A
For z = LBound(a) To UBound(a) 'X为A的上限至下限

For i = 1 To Len(a(z)) Step 28 '把A中的段落分成28个字符一组
Printer.CurrentX = 23 '定义X坐标
x = x + 10
Printer.CurrentY = x '定义开始Y坐标
k = Printer.CurrentX '调试语句
p = Printer.CurrentY '调试语句
str = Mid(a(z), i, 28) 调试语句
If Printer.CurrentY < 270 Then '如果未到达底线
Printer.Print Trim(Mid(a(z), i, 28)) '打印单个字符
Else
Printer.NewPage '否则换页
'打印格式

'打印第二页页首
Printer.ScaleWidth = 210
Printer.ScaleHeight = 297

Printer.CurrentX = 152
Printer.CurrentY = 15
Printer.Print "第 页共 页"
Printer.DrawWidth = 6
Printer.Line (158, 21)-(166, 21)
Printer.Line (179, 21)-(188, 21)
'打印横线
Printer.CurrentX = 22
Printer.CurrentY = 25
Printer.DrawWidth = 10
Printer.Line (22, 25)-(198, 25)
Dim j As Integer
For j = 35 To 275 Step 10
If j = 275 Then
Printer.DrawWidth = 10
Printer.Line (22, j)-(198, j)
Else
Printer.DrawWidth = 6
Printer.Line (24, j)-(195, j)
End If
Next j
Printer.CurrentX = 23
Printer.CurrentY = 30 '定义新一页的y坐标
x = 30
Printer.Print Mid(a(z), i, 28) '继续打印字符
End If
Next i
Next z
===============================================
form2.text1.text中的内容为
kkkkkkkkkkkkkkkkkkkkkkkkkk
kkkkkkkkkkkkkkkkkkkkkkkkkk
kkk
kkkkkkkkkkkkkkkkkkkkkkkkkk
kkkkkkkkkkkkkkkkkkkkkkkkkk
kkk

打印出来为
kkkkkkkkkkkkkkkkkkkkkkkkkk
kkkkkkkkkkkkkkkkkkkkkkkkkk
kkk

kkkkkkkkkkkkkkkkkkkkkkkkkk 问题在句,与下一句重叠半个字符,且X坐标从0开 始
kkkkkkkkkkkkkkkkkkkkkkkkkk
kkk

搜索更多相关主题的帖子: printer 
2007-05-07 18:53
shinni
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-5-7
收藏
得分:0 
回复:(shinni)请教printer问题

难道没有人知道,问题真的那么难?

2007-05-12 21:33
快速回复:请教printer问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016967 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved