I have a multi-line textbox that displays a row of data from a SELECT query. How can I get this text to printout. Do I need to add the printdialog and printdocument to the form, or can i do it all with code??
Hello buddyel,
In order to print the text you need to add a printdocument object on your form. then you need to add the following:
----------------- PrintDocument1.PrintPage -------------
Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
e.Graphics.DrawString(txtOut.text, New Font("Arial", 20), Brushes.Black, 10, 10)
End Sub
and also add PrintDocument1.Print() where you want to print the text
hi, how about i need to print an entire form. Because the program im working on is connect to database. that is why there is no variable or anything. In this program, i have two table, one on the main form and the other one is at the detail form..Would you please tell me how can i create a button which can print the whole document
thanks
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.