Friday, July 12, 2019

Print & Preview visual studio


Two button  +  PrintDocument1  +  PrintPreviewDialog1  +  RichTextBox1

 Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        If RichTextBox1.Text = "" Then
            MsgBox("Your Text is blank. please type something")
        Else
            PrintPreviewDialog1.ShowDialog()
        End If
    End Sub

    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
        PrintDocument1.Print()
    End Sub

    Private Sub PrintDocument1_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
        Dim font As New Font("Arial", 16, FontStyle.Regular)
        e.Graphics.DrawString(RichTextBox1.Text, font, Brushes.Black, 100, 100)
    End Sub
Share:

0 comments:

Post a Comment

Video

DOWNLOAD SYSTEM PHOTO

Click on the w3schools logo to download the image:

W3Schools

Note: The download attribute is not supported in Edge version 12, IE, Safari 10 (and earlier), or Opera version 12 (and earlier).

bd-rms-it.com

Powered by Blogger.

MESSANGER

 
See Here Color Code :





SHEBA COMPUTER
SHEBA COMPUTER