高分求vb6.0代码! 20
http://zhidao.baidu.com/question/252219421.html这个悬赏100分,两个相同问题目的:打印指定内容到10cm×6cm的纸张上。...
http://zhidao.baidu.com/question/252219421.html 这个悬赏100分,两个相同问题
目的:打印指定内容到 10cm × 6cm 的纸张上。(例如打印“hello world” 这样一句话)
要求:1.系统:win xp ,普通打印机
2.无论什么方法,模板也好,设置自定义纸张也行,达到目的为止
3.注释详细是最好了。
小弟不胜感激,要多少分您说了算,这100算定金 展开
目的:打印指定内容到 10cm × 6cm 的纸张上。(例如打印“hello world” 这样一句话)
要求:1.系统:win xp ,普通打印机
2.无论什么方法,模板也好,设置自定义纸张也行,达到目的为止
3.注释详细是最好了。
小弟不胜感激,要多少分您说了算,这100算定金 展开
3个回答
展开全部
Private Sub Command2_Click()
' vbPRPSLetter 1 Letter, 8 1/2 x 11 in.
' vbPRPSLetterSmall 2 Letter Small, 8 1/2 x 11 in.
' vbPRPSTabloid 3 Tabloid, 11 x 17 in.
' vbPRPSLedger 4 Ledger, 17 x 11 in.
' vbPRPSLegal 5 Legal, 8 1/2 x 14 in.
' vbPRPSStatement 6 Statement, 5 1/2 x 8 1/2 in.
' vbPRPSExecutive 7 Executive, 7 1/2 x 10 1/2 in.
' vbPRPSA3 8 A3, 297 x 420 mm
' vbPRPSA4 9 A4, 210 x 297 mm
' vbPRPSA4Small 10 A4 Small, 210 x 297 mm
' vbPRPSA5 11 A5, 148 x 210 mm
' vbPRPSB4 12 B4, 250 x 354 mm
' vbPRPSB5 13 B5, 182 x 257 mm
' vbPRPSFolio 14 Folio, 8 1/2 x 13 in.
' vbPRPSQuarto 15 Quarto, 215 x 275 mm
' vbPRPS10x14 16 10 x 14 in.
' vbPRPS11x17 17 11 x 17 in.
' vbPRPSNote 18 Note, 8 1/2 x 11 in.
' vbPRPSEnv9 19 Envelope #9, 3 7/8 x 8 7/8 in.
' vbPRPSEnv10 20 Envelope #10, 4 1/8 x 9 1/2 in.
' vbPRPSEnv11 21 Envelope #11, 4 1/2 x 10 3/8 in.
' vbPRPSEnv12 22 Envelope #12, 4 1/2 x 11 in.
' vbPRPSEnv14 23 Envelope #14, 5 x 11 1/2 in.
' vbPRPSCSheet 24 C size sheet
' vbPRPSDSheet 25 D size sheet
' vbPRPSESheet 26 E size sheet
' vbPRPSEnvDL 27 Envelope DL, 110 x 220 mm
' vbPRPSEnvC3 29 Envelope C3, 324 x 458 mm
' vbPRPSEnvC4 30 Envelope C4, 229 x 324 mm
' vbPRPSEnvC5 28 Envelope C5, 162 x 229 mm
' vbPRPSEnvC6 31 Envelope C6, 114 x 162 mm
' vbPRPSEnvC65 32 Envelope C65, 114 x 229 mm
' vbPRPSEnvB4 33 Envelope B4, 250 x 353 mm
' vbPRPSEnvB5 34 Envelope B5, 176 x 250 mm
' vbPRPSEnvB6 35 Envelope B6, 176 x 125 mm
' vbPRPSEnvItaly 36 Envelope, 110 x 230 mm
' vbPRPSEnvMonarch 37 Envelope Monarch, 3 7/8 x 7 1/2 in.
' vbPRPSEnvPersonal 38 Envelope, 3 5/8 x 6 1/2 in.
' vbPRPSFanfoldUS 39 U.S. Standard Fanfold, 14 7/8 x 11 in.
' vbPRPSFanfoldStdGerman 40 German Standard Fanfold, 8 1/2 x 12 in.
' vbPRPSFanfoldLglGerman 41 German Legal Fanfold, 8 1/2 x 13 in.
' vbPRPSUser 256 User-defined
'如果设置Printer.PaperSize为vbPRPSUser,则表示使用“用户定义”纸张,此时纸张大小由打印机 Height 和 Width 属性决定。如果设置打印机 Height 和 Width 属性自动地将 PaperSize 设置为 vbPRPSUser。
Dim s1 As String
Dim s2 As String
Dim i As Integer
With Printer
.ScaleMode = 6 'mm
.PaperSize = vbPRPSUser
.Width = 100
.Height = 60
.ScaleMode = 1 'Tip
s1 = "HELLO THE WORLD"
.FontBold = True
.FontSize = 18
.CurrentX = (.Width - .TextWidth("s1")) / 2
.CurrentY = 2 * 567
Printer.Print s1
.FontBold = False
.FontSize = 10
.CurrentY = .CurrentY + 1 * 567
For i = 0 To 9
.CurrentX = 2 * 567
s1 = "字段" & i & "=Result" & i
Printer.Print s1
Next i
.EndDoc
End With
End Sub
' vbPRPSLetter 1 Letter, 8 1/2 x 11 in.
' vbPRPSLetterSmall 2 Letter Small, 8 1/2 x 11 in.
' vbPRPSTabloid 3 Tabloid, 11 x 17 in.
' vbPRPSLedger 4 Ledger, 17 x 11 in.
' vbPRPSLegal 5 Legal, 8 1/2 x 14 in.
' vbPRPSStatement 6 Statement, 5 1/2 x 8 1/2 in.
' vbPRPSExecutive 7 Executive, 7 1/2 x 10 1/2 in.
' vbPRPSA3 8 A3, 297 x 420 mm
' vbPRPSA4 9 A4, 210 x 297 mm
' vbPRPSA4Small 10 A4 Small, 210 x 297 mm
' vbPRPSA5 11 A5, 148 x 210 mm
' vbPRPSB4 12 B4, 250 x 354 mm
' vbPRPSB5 13 B5, 182 x 257 mm
' vbPRPSFolio 14 Folio, 8 1/2 x 13 in.
' vbPRPSQuarto 15 Quarto, 215 x 275 mm
' vbPRPS10x14 16 10 x 14 in.
' vbPRPS11x17 17 11 x 17 in.
' vbPRPSNote 18 Note, 8 1/2 x 11 in.
' vbPRPSEnv9 19 Envelope #9, 3 7/8 x 8 7/8 in.
' vbPRPSEnv10 20 Envelope #10, 4 1/8 x 9 1/2 in.
' vbPRPSEnv11 21 Envelope #11, 4 1/2 x 10 3/8 in.
' vbPRPSEnv12 22 Envelope #12, 4 1/2 x 11 in.
' vbPRPSEnv14 23 Envelope #14, 5 x 11 1/2 in.
' vbPRPSCSheet 24 C size sheet
' vbPRPSDSheet 25 D size sheet
' vbPRPSESheet 26 E size sheet
' vbPRPSEnvDL 27 Envelope DL, 110 x 220 mm
' vbPRPSEnvC3 29 Envelope C3, 324 x 458 mm
' vbPRPSEnvC4 30 Envelope C4, 229 x 324 mm
' vbPRPSEnvC5 28 Envelope C5, 162 x 229 mm
' vbPRPSEnvC6 31 Envelope C6, 114 x 162 mm
' vbPRPSEnvC65 32 Envelope C65, 114 x 229 mm
' vbPRPSEnvB4 33 Envelope B4, 250 x 353 mm
' vbPRPSEnvB5 34 Envelope B5, 176 x 250 mm
' vbPRPSEnvB6 35 Envelope B6, 176 x 125 mm
' vbPRPSEnvItaly 36 Envelope, 110 x 230 mm
' vbPRPSEnvMonarch 37 Envelope Monarch, 3 7/8 x 7 1/2 in.
' vbPRPSEnvPersonal 38 Envelope, 3 5/8 x 6 1/2 in.
' vbPRPSFanfoldUS 39 U.S. Standard Fanfold, 14 7/8 x 11 in.
' vbPRPSFanfoldStdGerman 40 German Standard Fanfold, 8 1/2 x 12 in.
' vbPRPSFanfoldLglGerman 41 German Legal Fanfold, 8 1/2 x 13 in.
' vbPRPSUser 256 User-defined
'如果设置Printer.PaperSize为vbPRPSUser,则表示使用“用户定义”纸张,此时纸张大小由打印机 Height 和 Width 属性决定。如果设置打印机 Height 和 Width 属性自动地将 PaperSize 设置为 vbPRPSUser。
Dim s1 As String
Dim s2 As String
Dim i As Integer
With Printer
.ScaleMode = 6 'mm
.PaperSize = vbPRPSUser
.Width = 100
.Height = 60
.ScaleMode = 1 'Tip
s1 = "HELLO THE WORLD"
.FontBold = True
.FontSize = 18
.CurrentX = (.Width - .TextWidth("s1")) / 2
.CurrentY = 2 * 567
Printer.Print s1
.FontBold = False
.FontSize = 10
.CurrentY = .CurrentY + 1 * 567
For i = 0 To 9
.CurrentX = 2 * 567
s1 = "字段" & i & "=Result" & i
Printer.Print s1
Next i
.EndDoc
End With
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
AiPPT
2024-09-19 广告
2024-09-19 广告
作为北京饼干科技有限公司的工作人员,关于AIPPT免费生成PPT的功能,我可以简要介绍如下:AIPPT是一款基于人工智能技术的PPT制作工具,它为用户提供了免费生成PPT的便捷服务。用户只需简单输入PPT的主题或内容大纲,AIPPT便能智能...
点击进入详情页
本回答由AiPPT提供
展开全部
Private Sub Command1_Click()
Printer.Orientation = 1
Printer.ScaleMode = 7
Printer.Height = 10
Printer.Width = 6
Printer.ScaleLeft = -0.75 * 1440
Printer.ScaleTop = -0.75 * 1440
Printer.Print "Hello World"
Printer.EndDoc
Printer.killDoc
End Sub
Printer.Orientation = 1
Printer.ScaleMode = 7
Printer.Height = 10
Printer.Width = 6
Printer.ScaleLeft = -0.75 * 1440
Printer.ScaleTop = -0.75 * 1440
Printer.Print "Hello World"
Printer.EndDoc
Printer.killDoc
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2011-04-13
展开全部
Private Sub Form_Load()
Printer.PaperSize = vbPRPSUser
Printer.ScaleMode = vbInches
Printer.Height = 10 * 567
Printer.Width = 6 * 567
Printer.Print "Hello World"
Printer.EndDoc
End Sub
Printer.PaperSize = vbPRPSUser
Printer.ScaleMode = vbInches
Printer.Height = 10 * 567
Printer.Width = 6 * 567
Printer.Print "Hello World"
Printer.EndDoc
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询