Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
<Canvas Grid.Column="0" Name="_printcanvas" >
               <Ellipse Fill="Gainsboro" Canvas.Left="25" Canvas.Top="25" Width="174" Height="175" />
               <Rectangle Fill="LightBlue" Canvas.Left="25" Canvas.Top="25" Width="50" Height="50" />
               <Rectangle Fill="LightCoral" Canvas.Left="50" Canvas.Top="50" Width="50" Height="50" />
               <Rectangle Fill="LightCyan" Canvas.Left="75" Canvas.Top="75" Width="50" Height="50" />
               <Label x:Name="client_name" Content="Label" Canvas.Left="10" Canvas.Top="200"/>
           </Canvas>


VB
Private Sub PrintPv_Click(sender As Object, e As RoutedEventArgs) Handles PrintPv.Click
        Dim printPVdialog As New System.Windows.Forms.PrintPreviewDialog
        printPVdialog.ShowDialog()
  End Sub


but it's empty.
izit need to add canvas into printPVdialog.Document?
is able to do like this?

What I have tried:

If printDialog.ShowDialog() = True Then
printDialog.PrintVisual(_printcanvas, "A Scaled Drawing")
End If

I have try this but this can't preview
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900