viernes, 17 de abril de 2015

Clase Printer








' gambas class file

'by postapase

Public Sub btnClear_Click()
TextArea1.Clear
End

Public Sub btnImprimir_Click()
Printer1.Print()
End

Public Sub Printer1_Draw()
Dim PRINT_MARGIN As Float = Paint.Width / Printer1.PaperWidth * 10
Dim Datos As String[]
Dim DatosAimprimir, Xlinea As String

Datos = Split(TextArea1.Text, gb.NewLine) 'separando cada linea por salto de linea del TextArea

For Each Xlinea In Datos
DatosAimprimir &= Trim$(Xlinea) & gb.CrLf 'agrego salto de linea entendible por la impresora
Next

Paint.DrawRichText(DatosAimprimir, PRINT_MARGIN, PRINT_MARGIN,,, Align.TopNormal)

End

Public Sub btnSalir_Click()
Me.Close
End

Public Sub Form_Open()
Me.Center
End

No hay comentarios.:

Publicar un comentario