كيف يمكنني أن احول حصائص الصفحة من اليسار الى اليمن
في هذا الكود
متغيرات
Dim boox As PrintDocument
Dim BOOX_in As New PrintPreviewDialog
الدالة
Private Sub Print(ByVal sender As Object, ByVal e As PrintPageEventArgs)
Try
Dim IDX As Integer = 300
Dim AUTX As Integer = 400
Dim FIE As String
Dim CURR As Integer = 0
Dim CURRX As Integer = 100
Dim REP As New Font("Arial", 12, FontStyle.Regular)
Dim rep_fon As Integer = REP.GetHeight(e.Graphics)
Dim Cou As Integer
FIE = "بسم الله الرحمن الرحيم".Trim
e.Graphics.DrawString(FIE, REP, Brushes.Black, AUTX, 80)
Cou = ListBox1.Items.Count
While CURR <= Cou
If CURR < Cou Then
FIE = ListBox1.Items(CURR).ToString.Trim
e.Graphics.DrawString(FIE, REP, Brushes.Black, AUTX, CURRX)
CURRX = CURRX + rep_fon
End If
If CURR = Cou Then
Exit While
End If
CURR += 1
End While
Dim REP2 As New Font("Arial", 18, FontStyle.Regular)
Dim rep_fon2 As Integer = REP.GetHeight(e.Graphics)
FIE = "تم الطباعة".Trim
e.Graphics.DrawString(FIE, REP2, Brushes.Red, IDX, 1000)
If CURR <= Cou Then
e.HasMorePages = False
Else
e.HasMorePages = True
End If
Catch ex As Exception
End Try
End Sub
طريقة الاستدعاء
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
boox = New PrintDocument()
AddHandler boox.PrintPage, AddressOf Print
BOOX_in.Document = boox
BOOX_in.ShowDialog()
End Sub