If PrintOption is set to ClientAreaOnly, FullWindow, or Scrollable, any form in your application may be specified, even if it does not have focus. If the form specified in the printForm parameter does not have focus, and the PrintOption parameter is set to either CompatibleModeClientAreaOnly or CompatibleModeFullWindow, an exception is raised. This includes any text or graphics drawn with Graphics methods. The Print method prints all visible objects on a form. PrintOption:PrintForm.PrintOption -> unitĪ PrintForm.PrintOption enumeration that determines how the form will be printed. Namespace: Assembly: (in .dll) Syntax public void Print( PrintForm Class an image of a Windows Form to the destination specified by the PrintAction property, specifying the form and printing options This example requires that you have a PrintForm component named PrintForm1 and three RadioButton controls on a form. The following example demonstrates how to set the PrintAction property. To do this, use a SaveFileDialog component and assign the return value to the PrintFileName property before calling the Print method. To make sure that the file has a valid path and extension, you can implement your own dialog box. The user is not prompted for a path or file name extension. If no file name is specified, the user is prompted for a file name. ai) in the path specified by the PrintFileName property. When PrintToFile is selected, an image of the form is saved to an Encapsulated PostScript file (.eps. When PrintToPreview is selected, the form is displayed in a standard Windows Forms PrintPreviewDialog control. If no default printer is available, the user is prompted to select a printer. You can override this behavior and explicitly set the printer and printer properties by using the PrinterSettings property. When PrintToPrinter is selected, the output is directed to the system default printer. Public Property PrintAction As PrintAction Member PrintAction : PrintAction with get, set Gets or sets a value indicating whether the output is directed to a printer, to a print preview window, or to a file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |