Search code examples
vb.netprintingpreview

VB.Net Print Preview Icon Change


I am back again with another question that I could not find answer to in the search engines; I am trying to change the Print Preview Icon to be same as the Main form (Form1) icon;

I tried the following without success; I appreciate the help.

     PrintPreviewDialog1.ShowIcon = My.Resources.Icon
     PrintPreviewDialog1.Icon = Me.Icon
     PrintPreviewDialog1.Icon = Form1.Icon

Solution

  • Not sure what problems or errors that you are getting. Creating a small test application where I am dynamically creating the PrintPreviewDialog and assigning the Form's Icon to it before showing it works for me.

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim printPreviewDialog1 As New PrintPreviewDialog
        printPreviewDialog1.Icon = Icon
        printPreviewDialog1.ShowDialog()
    End Sub