POSICIONAR TEXTO NA PAGINA
Private Sub command1_click()
1 Dim line As String
2 Dim xpos As Integer
3 Dim ypos As Integer
4 line = text1ltext
5 xpos = Text2.Text
6 ypos = Text3.Text
7 Printer.CurrentX = xpos
8 Printer.CurrentY = ypos
9 Printer.Print line
10 Printer.EndDoc
End Sub
Private Sub form_loa()
1 label1lcaption = [Ô]line to print:[Ô]
2 Text1.Text = [Ô]default line[Ô]
3 Label2.Caption = [Ô]y position:[Ô]
4 Text2.Text = [Ô]0[Ô]
5 Label3.Caption = [Ô]y position:[Ô]
6 Label4.Caption = [Ô]printer width: [Ô] & Printer.Width & _
Label5.Caption = [Ô]printer height [Ô] & Printer.Width
7 Command1.Caption = [Ô]print text[Ô]
8 Printer.FontSize = 24
End Sub
Citação:MANCKENNA escreveu:
Este projeto não apresenta erro nenhum mas também não funciona.....
Private Sub command1_click()
1 Dim line As String
2 Dim xpos As Integer
3 Dim ypos As Integer
4 line = text1ltext
5 xpos = Text2.Text
6 ypos = Text3.Text
7 Printer.CurrentX = xpos
8 Printer.CurrentY = ypos
9 Printer.Print line
10 Printer.EndDoc
End Sub
Private Sub form_loa()
1 label1lcaption = [Ô]line to print:[Ô]
2 Text1.Text = [Ô]default line[Ô]
3 Label2.Caption = [Ô]y position:[Ô]
4 Text2.Text = [Ô]0[Ô]
5 Label3.Caption = [Ô]y position:[Ô]
6 Label4.Caption = [Ô]printer width: [Ô] & Printer.Width & _
Label5.Caption = [Ô]printer height [Ô] & Printer.Width
7 Command1.Caption = [Ô]print text[Ô]
8 Printer.FontSize = 24
End Sub
Exemplo 1:
Private Sub form_loa()
Private Sub Form_Load()
Exemplo 2:
line = text1ltext
line = Text1.Text
Analise o código CUIDADOSAMENTE e teste NOVAMENTE.
Private Sub command1_click()
1 Dim line As String
2 Dim xPos As Integer
3 Dim yPos As Integer
4 line = Text1.Text
5 xPos = Text2.Text
6 yPos = Text3.Text
7 Printer.CurrentX = xPos
8 Printer.CurrentY = yPos
9 Printer.Print line
10 Printer.EndDoc
End Sub
Private Sub Form_Load()
1 Label1.Caption = [Ô]Line to print:[Ô]
2 Text1.Text = [Ô]Default line[Ô]
3 Label2.Caption = [Ô]X position:[Ô]
4 Text2.Text = [Ô]0[Ô]
5 Label3.Caption = [Ô]y position:[Ô]
6 Text3.Text = [Ô]0[Ô]
7 Label4.Caption = [Ô]printer width: [Ô] & Printer.Width & _
Label5.Caption = [Ô]printer height: [Ô] & Printer.Height
8 Command1.Caption = [Ô]Print Text[Ô]
9 Printer.FontSize = 24
End Sub