vb.net print the specified file-(currently the print file name)

Source: Internet
Author: User

Public Class Form1 Private Sub Form1_Load (sender as System.Object, E as System.EventArgs) Handles MyBase.Load Op        Enfiledialog1.showdialog () TextBox1.Text = Openfiledialog1.filename ' Printdocument1.print () Print () End Sub Private Sub printdocument1_printpage (sender as System.Object, E as System.Drawing.Printing.Pr Intpageeventargs) Handles printdocument1.printpage e.graphics.drawstring (TextBox1.Text, New Font ("Arial"), New Pen (Color.Black, 1). Brush, E.graphics.fillrectangle (Brushes.blue, New Rectangle (p, p, max)) End Sub Sub Rint () Dim printdialog1 as New PrintDialog () ' PrintDialog1.        ShowDialog () ' PrintDocument1 = OpenFileDialog1.FileName.ToString printdialog1.document = PrintDocument1 Dim Rusult as DialogResult = PrintDialog1. ShowDialog () If Rusult = DialogResult.OK then Printdocument1.print () End If End SubEnd Class

  

vb.net print the specified file-(currently the print file name)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.