以下代码不知道哪里错了,用pageSetupDialog进行设置的页边距不能在GcMultiRow1.PrintPreview()中提现出来
用GcMultiRow1.PageSetup()设置的页边距可以在GcMultiRow1.PrintPreview()中提现出来,但代码如何访问到 GcMultiRow1.PageSetup()设置的页边距。
Dim document As System.Drawing.Printing.PrintDocument = New PrintDocument()
Dim pageSetupDialog As PageSetupDialog = New PageSetupDialog()
pageSetupDialog.Document = document
With document.DefaultPageSettings
.Margins.Top = 0
.Margins.Left = 0
End With
If pageSetupDialog.ShowDialog(Me) = Windows.Forms.DialogResult.OK Then
GcMultiRow1.Document = document
With GcMultiRow1.PrintSettings
.PrintStyle = GrapeCity.Win.MultiRow.PrintStyle.Compact
.AutoFitWidth = True
End With
GcMultiRow1.PageSetup()
GcMultiRow1.PrintPreview()
End If |
|