martes, 1 de abril de 2014

Impresion con VB6



Les dejo algunos ejemplos de impresiones que se pueden hacer en VB6. Por lo general el codigo se suele poner en un boton.
'Imprimir una linea
Printer.Print "Hola a todos! 1" 
Printer.EndDoc

'Otro ejemplo con mas de una linea
Printer.Print "Hola a todos! 1" 
Printer.Print "Hola a todos! 2" 
Printer.EndDoc
'Imprimir en mas de un papel
Printer.Print "Pagina 1" 
Printer.NewPage 
Printer.Print "Pagina 2" 
Printer.EndDoc 
'impresion de una variable
Dim hab as String
hab="ejemplo"
Printer.Print hab
'impresion de una imagen
Printer.PaintPicture picture1.Picture, 10, 30, 2355, 1035
'Supongamos que el listbox que tiene esta con el nombre por default "List1"
For n = 0 to (List1.ListCount - 1)
Printer.Print List1.List(n)
Next
Printer.EndDoc 
'Algunos efectos
Printer.Font = "Arial" 'fuente
Printer.FontSize = 90 'tamaño
Printer.CurrentY = 800 'vertical
Printer.CurrentX = 300 'horizontal
Printer.FontBold = True 'negrita
Printer.FontItalic = True 'italic
Printer.FontUnderline = True 'subrayado


No hay comentarios:

Publicar un comentario