يآخوان هذا الموضوع تاعبني جداً .... وياليت واحد فيكم يتكرم ويحل هذه المشكله .
الموضوع هذا طرحته في هذا المنتدى أكثر من مره
وهو كيف يتم أنشاء صفحة جديدة في التقرير ... والحل هو في المتغير e.HasMorePages = True
ولكن بائت محاولاتي بالفشل فهل توضحون لي ...
أوريد الحل في تصحيح هذا الكود (توجد أكواد كثيرة في هذا المنتدى ولكن ليست هي مبتغيا )..
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim I As Integer = 0
For I = 0 To 200
ListBox1.Items.Add(I)
Next
End Sub
Private Sub pag_print(ByVal sender As Object, ByVal e As PrintPageEventArgs)
Dim strFormat As New StringFormat(StringFormatFlags.DirectionRightToLeft)
Dim FONT As New Font("Arial", 18, FontStyle.Regular)
Dim FIE As String
Dim Count As Integer = 1
Dim H As Integer = 20
For Count = 0 To ListBox1.Items.Count
Dim ID1 As New RectangleF(400, H, 50, e.MarginBounds.Height)
FIE = ListBox1.Items(Count).ToString.Trim
e.Graphics.DrawString(FIE, FONT, Brushes.Black, ID1, strFormat)
H = H + 20
Count += 1
Next
If Count < 10 Then
e.HasMorePages = True
Else
e.HasMorePages = False
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim booX As PrintDocument
Dim P As New PrintPreviewDialog
booX = New PrintDocument()
AddHandler booX.PrintPage, AddressOf pag_print
P.Document = booX
P.ShowDialog()
End Subجزاكم الله خير ....