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
有帮助吗?

解决方案

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
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top