Public Class Form1
Private Sub visti_Click(sender As Object, e As EventArgs) Handles visti.Click
With PrintForm1
pilin2.Show()
pilin2.Focus()
.PrintAction = Printing.PrintAction.PrintToPreview
.Print(printForm:=pilin2, PowerPacks.Printing.PrintForm.PrintOption.FullWindow)
pilin2.Visible = False
pilin2.Close()
End With
End Sub
End Class