30-10-17, 07:15 PM
انا استخدمت هذا الكود ولكن يقطع قاعدة الصفحة الاولي وينتقل الي قاعدة الصفحة التالية وليس اعلي الصفحة
Static Lines() As String = Label1.Text.Split(vbCrLf)
Static Font As New Font("Arial", 10, FontStyle.Regular, GraphicsUnit.Pixel)
Static I As Integer
Dim bmp As System.Drawing.Bitmap
bmp = PictureBox1.Image
Dim VerticalPos As Integer = 1000
Do
e.Graphics.DrawString(Lines(I), Font, Brushes.Black, 200, VerticalPos)
I += 1
VerticalPos += Font.Height
e.Graphics.DrawImage(bmp, 200, VerticalPos + 100)
If VerticalPos > e.PageBounds.Bottom Then
e.Graphics.DrawImage(bmp, 200, VerticalPos)
e.HasMorePages = True
Return
End If
Loop Until I = Lines.Length
End Sub
Static Lines() As String = Label1.Text.Split(vbCrLf)
Static Font As New Font("Arial", 10, FontStyle.Regular, GraphicsUnit.Pixel)
Static I As Integer
Dim bmp As System.Drawing.Bitmap
bmp = PictureBox1.Image
Dim VerticalPos As Integer = 1000
Do
e.Graphics.DrawString(Lines(I), Font, Brushes.Black, 200, VerticalPos)
I += 1
VerticalPos += Font.Height
e.Graphics.DrawImage(bmp, 200, VerticalPos + 100)
If VerticalPos > e.PageBounds.Bottom Then
e.Graphics.DrawImage(bmp, 200, VerticalPos)
e.HasMorePages = True
Return
End If
Loop Until I = Lines.Length
End Sub

