You can make use of the PrintForm class from the Power Packs.
Public Class Form2 Public WriteOnly Property _PrintForm As Boolean Set(value As Boolean) If value = True Then Dim pf As New PrintForm pf.Form = Me pf.PrintAction = PrintToPrinter pf.Print() End If End Set End Property End Class
Then to call it from form1:
Public Class Form1 Private btnPrint_Click(ByVal sender As Object,ByVal e As EventArgs) Handles btnPrint.Click Form2._PrintForm = True End Sub End Class
Or, you can manually print by using the PrintDocument event of a printing job.
This will require the use of the Graphics class.
Edited 3 Years Ago by Begginnerdev
If you're printing a registration form, you probably don't want any of the extra stuff, like the control box or any buttons, to be printed. Something like this might work:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click 'make any controls you don't want printed invisible Button3.Visible = False 'print everything visible in the client area(no control box or form title) PrintForm1.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.CompatibleModeClientAreaOnly) 'then make them visible again Button3.Visible = True End Sub
Edited 3 Years Ago by tinstaafl
The resolution of printform is low and hoe to fix itl? that is make it high
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...
Hi. so this is actually a continuation from another question of mineHere but i was advised to start a new thread as the original question was already answered.
This is the result of previous question answered :
code for the listbox - datagridview interaction
At the top of the code ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...