Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Enables printing an image of a Windows Form at run time.
Namespace: Microsoft.VisualBasic.PowerPacks.Printing
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
Inheritance Hierarchy
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
Microsoft.VisualBasic.PowerPacks.Printing.PrintForm
Syntax
[ToolboxBitmapAttribute(typeof(PrintForm), "Microsoft.VisualBasic.PowerPacks.Printing.PrintForm.bmp")]
public class PrintForm : Component
[ToolboxBitmapAttribute((PrintForm^::typeid), "Microsoft.VisualBasic.PowerPacks.Printing.PrintForm.bmp")]
public ref class PrintForm : Component
[<ToolboxBitmapAttribute(typeof(PrintForm), "Microsoft.VisualBasic.PowerPacks.Printing.PrintForm.bmp")>]
type PrintForm =
class
inherit Component
end
<ToolboxBitmapAttribute(GetType(PrintForm), "Microsoft.VisualBasic.PowerPacks.Printing.PrintForm.bmp")>
Public Class PrintForm
Inherits Component
Constructors
Name | Description | |
---|---|---|
![]() |
PrintForm() | Initializes a new instance of the PrintForm class. |
![]() |
PrintForm(Form) | Initializes a new instance of the PrintForm class, specifying the Form where it will be parented. |
![]() |
PrintForm(IContainer) | Initializes a new instance of the PrintForm class, specifying the IContainer in which it will be parented. |
Properties
Name | Description | |
---|---|---|
![]() |
CanRaiseEvents | (Inherited from Component.) |
![]() |
Container | (Inherited from Component.) |
![]() |
DesignMode | (Inherited from Component.) |
![]() |
DocumentName | Gets or sets the document name to display (for example, in a print status dialog box or printer queue) while printing the document. |
![]() |
Events | (Inherited from Component.) |
![]() |
Form | Gets or sets the form to be printed. |
![]() |
PrintAction | Gets or sets a value indicating whether the output is directed to a printer, to a print preview window, or to a file. |
![]() |
PrinterSettings | Gets or sets a PrinterSettings object that you can use to specify various properties of a printer. |
![]() |
PrintFileName | Gets or sets the file name of an Encapsulated PostScript file and the path to which the file will be saved when the PrintAction property is set to PrintToFile. |
![]() |
Site | (Inherited from Component.) |
Methods
Name | Description | |
---|---|---|
![]() |
CreateObjRef(Type) | (Inherited from MarshalByRefObject.) |
![]() |
Dispose() | (Inherited from Component.) |
![]() |
Dispose(Boolean) | Releases the unmanaged resources used by a PrintForm component and optionally releases the managed resources.(Overrides Component.Dispose(Boolean).) |
![]() |
Equals(Object) | (Inherited from Object.) |
![]() |
Finalize() | (Inherited from Component.) |
![]() |
GetHashCode() | (Inherited from Object.) |
![]() |
GetLifetimeService() | (Inherited from MarshalByRefObject.) |
![]() |
GetService(Type) | (Inherited from Component.) |
![]() |
GetType() | (Inherited from Object.) |
![]() |
InitializeLifetimeService() | (Inherited from MarshalByRefObject.) |
![]() |
MemberwiseClone() | (Inherited from Object.) |
![]() |
MemberwiseClone(Boolean) | (Inherited from MarshalByRefObject.) |
![]() |
OnBeginPrint(PrintEventArgs) | Raises the BeginPrint event. |
![]() |
OnEndPrint(PrintEventArgs) | Raises the EndPrint event. |
![]() |
OnQueryPageSettings(QueryPageSettingsEventArgs) | Raises the QueryPageSettings event. |
![]() |
Print() | Sends an image of a Windows Form to the destination specified by the PrintAction property. |
![]() |
Print(Form, PrintForm.PrintOption) | Sends an image of a Windows Form to the destination specified by the PrintAction property, specifying the form and printing options |
![]() |
ToString() | (Inherited from Component.) |
Events
Name | Description | |
---|---|---|
![]() |
BeginPrint | Occurs when the Print method is called, before the first page of the document prints. |
![]() |
Disposed | (Inherited from Component.) |
![]() |
EndPrint | Occurs when the last page of the document has printed. |
![]() |
QueryPageSettings | Occurs immediately before each page is printed. |
Remarks
The PrintForm component enables you to print an image of a form to a printer, to a print preview window, or to a file at run time. Its behavior replaces that of the PrintForm method in earlier versions of Visual Basic.
Examples
The following example shows a common use of the PrintForm component.
Dim pf As New PrintForm
pf.Form = Me
pf.PrintAction = PrintToPrinter
pf.Print()
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Microsoft.VisualBasic.PowerPacks.Printing Namespace
PrintForm Component (Visual Basic)
How to: Print a Form by Using the PrintForm Component (Visual Basic)
How to: Print the Client Area of a Form (Visual Basic)
How to: Print Client and Non-Client Areas of a Form (Visual Basic)
How to: Print a Scrollable Form (Visual Basic)
Deploying Applications That Reference the PrintForm Component (Visual Basic)
Return to top