![]() PrintDocument1.DocumentName = TextBox1.Textĭim stream As New FileStream(PrintDocument1.DocumentName, FileMode.Open)ĭim pd As PrintDialog = New PrintDialog() Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click If OpenFileDialog1.ShowDialog() = .OK Then OpenFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*" Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As ) Handles MyBase.FormClosingīefore you can learn anything new you have to learn that there's stuff you don't know.ĭocument provided by leshay, and you can use PrintPreviewDialog1 control to preview multiple pages that need to be printed. Private Sub printAPage(ByVal sender As Object, ByVal e As PrintPageEventArgs)Į.Graphics.DrawString(pages(pageCount), Me.Font, b, 0, 0) Pages.Add("This is page " + i.ToString())ĭim pd As PrintDocument = New PrintDocument()ĪddHandler pd.PrintPage, AddressOf printAPage Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Imports ĭim pages As List(Of String) = New List(Of String)() ![]() I think the question here is about actual printing, not just drawing. What? Is not all the printing done via an e.Graphics.DrawString? That is not a text while it is e.Graphics.DrawString format.
0 Comments
Leave a Reply. |