24-12-12, 11:49 AM
هذا الكود لطباعة ال data grid view
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
PrintDocument2.Print()
End Sub
Private Sub PrintDocument2_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim bm As New Bitmap(Me.DataGridView1.Width, Me.DataGridView1.Height)
DataGridView2.DrawToBitmap(bm, New Rectangle(0, 0, Me.DataGridView1.Width, Me.DataGridView1.Height))
e.Graphics.DrawImage(bm, 0, 0)
End Sub
سؤالي؟ هذا يطبع فقط الظاهر من grid view في حال كانت البيانات كثيرة وكان هنالك scroll bar فكيف استطيع طباعة الكل الظاهر وغير الظاهر
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
PrintDocument2.Print()
End Sub
Private Sub PrintDocument2_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim bm As New Bitmap(Me.DataGridView1.Width, Me.DataGridView1.Height)
DataGridView2.DrawToBitmap(bm, New Rectangle(0, 0, Me.DataGridView1.Width, Me.DataGridView1.Height))
e.Graphics.DrawImage(bm, 0, 0)
End Sub
سؤالي؟ هذا يطبع فقط الظاهر من grid view في حال كانت البيانات كثيرة وكان هنالك scroll bar فكيف استطيع طباعة الكل الظاهر وغير الظاهر