الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

تحويل حصائص الطباعة من اليسار الى اليمين

مغلق
بدأه mam555 في 26 يوليو 2007 · 1 رد · 650 مشاهدة · في Microsoft Visual Basic.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

كيف يمكنني أن احول حصائص الصفحة من اليسار الى اليمن

في هذا الكود

متغيرات

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

#2

الحل وجده وكان في موضوع الاخ / محمد سامر أبو سلو

وكان يجب تعريف متغيرين

Dim strFormat As New StringFormat(StringFormatFlags.DirectionRightToLeft)

'Dim rectDraw As New RectangleF(e.MarginBounds.Left, e.MarginBounds.Top, e.MarginBounds.Width, e.MarginBounds.Height)

وطريقة كاتبه في الدالة

FIE = TextBox1.Text.Trim

e.Graphics.DrawString(FIE, REP, Brushes.Black, rectDraw, strFormat)

واذا اردت التحكم برمجياً في الهوامش

تغيير الهوامش في نفس الداله rectDraw

Dim rectDraw As New RectangleF(100, 1000, e.MarginBounds.Width, e.MarginBounds.Height)

هذا الموضوع مغلق.

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…