login  Naam:   Wachtwoord: 
Registreer je!
 Forum
Zoeken  Regels  Help
Categorieën > VB.NET

Print datagridview

SICKBOYYYYY – 11/02/2010 08:52
Welke code moet ik gebruiken om mijn datagridview af te printen?

mvg


5 antwoorden

Gesponsorde links
Daisycon - Verdien geld met uw website

Ontani – 11/02/2010 09:00
Maak je me toch niet wijs dat je google al open hebt gehad...

SICKBOYYYYY – 11/02/2010 09:06
Toch wel, maar vind alles in C ipv vb.NET en dat werkt van geen kanten hier 

Ontani – 11/02/2010 09:13

SICKBOYYYYY – 11/02/2010 09:22 (Laatst gewijzigd op 11/02/2010 09:34)
Wss voor VB.NET 2005 en ik werk met 2008 
  1. Private PrintGrid As DataGridViewPrint
  2. Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click
  3. Dim fpr As New frmPrint()
  4. With fpr
  5. .Title = DataGridView1.CaptionText
  6. .ShowDialog()
  7. If .Result > 0 Then
  8. PrintGrid = New DataGridViewPrint(PrintDocument1, DataGridView1, .bBlackWhite)
  9. PrintGrid.PrintTitle = .bTitle
  10. PrintGrid.Title = .Title
  11. Select Case .Result
  12. Case 1 ' Print
  13. ' The Print method prints the DataGridView without using a print dialog.
  14. ' Use a PrintDialog when you want to offer the user the ability to choose print settings.
  15. If PrintDialog1.ShowDialog() = DialogResult.OK Then PrintDocument1.Print()
  16. Case 2 ' Page Setup
  17. PageSetupDialog1.ShowDialog()
  18. Case 3 ' Preview
  19. PrintPreviewDialog1.Icon = fpr.Icon
  20. PrintPreviewDialog1.ShowDialog()
  21. End Select
  22. End If
  23. End With
  24. End Sub
  25.  
  26. ' Specify the output to print by handling the PrintPage event
  27. ' and by using the Graphics included in the PrintPageEventArgs.
  28. Private Sub printDocument1_PrintPage(ByVal sender As Object, ByVal e As PrintPageEventArgs) Handles PrintDocument1.PrintPage
  29. ' Print method of DataGridViewPrint class starts the custom DataGridView's printing process.
  30. e.HasMorePages = PrintGrid.Print(e.Graphics)
  31. End Sub




Ontani – 11/02/2010 09:36
Er is geen verschil tussen de datagridview van 2005 of 2008

Gesponsorde links

Dit onderwerp is gesloten.
Actieve forumberichten:

© 2002-2012 Sitemasters.be - Regels - Gehost door: Vircon - Laadtijd: 0.037s