30-03-13, 08:29 AM
محمود رغمان كتب :[SIZE=7]ربنا يصلح بالك [/SIZE]
نرجو أن تنظر لنا وتوفى بوعدك
بارك الله فيك
أرجو المعذرة، انشغلت عن عالم البرمجة قليلاً وأنا في هذه الأيام مجبر على العودة إليه وإلى عالم الطباعة بسبب مشروع متوسط
وسأفي إن شاء الله
محمود رغمان كتب :[SIZE=7]ربنا يصلح بالك [/SIZE]
نرجو أن تنظر لنا وتوفى بوعدك
بارك الله فيك
Ruru86 كتب :السلام عليكم
اخي لو سمحت هل ممكن من حفظ فورم الطباعة كملف ورد
وسؤال ثاني كيف بامكاني ان اطبع فاتورة تكون بأكثر من صفحة ولك مني جزيل الشكر
إقتباس :شكرا ابو يعقوب وبانتظار ردك على الطباعة في اكثر من صفحة
Ruru86 كتب :المشكلة اني اضفت ليست فيو وثم بعض النصوص عندما يصبح حجم الليست فيو اكبر من حد معين ينتقل كمالته للصفحة الثانية
اي لا يتم تكملة الليست فيو ومن ثم النص
وارغب ان يظهر لي page1of 2
page 2 of 2
فلا تظهر
jascar كتب :مشروع رائع جدا وانا اعمل عليه الان بكل كفاءة ولكن لدية اقتراح و أظن انا بعض المشاركيين يشاطروني الرائ وهو طباعة النص بشكل عمودي وهي خاصية تضاف الى الاداة printlabel حتي تضهر بشكل عمودي ومن ثمة يضاف اعدادات نص طباعة في كلاس
labelprint وفي الاخير تقبلو مني فائق التقدير و الشكر .عفوا على رداءة الكتاية
[align=left]Imports System.Drawing.Design
<ToolboxBitmap(GetType(Label))> _
Public Class PrintLabel
Inherits Label
Implements IPrintableControl
Friend Const pn As String = "[pn]"
Friend Const pc As String = "[pc]"
Private mRotationAngle As Double
Private mText As String
Public Sub New()
MyBase.AutoSize = False
End Sub
#Region "Properties"
#Region "Appearance"
<Category("Printing Appearance: Common"), Description("مساواة العرض أثناء الطباعة بالعرض أثناء التصميم")> _
Public Property FitMaxWidth As Boolean = True
<Category("Printing Appearance: Common"), Description("مساواة الطول أثناء الطباعة بالطول أثناء التصميم")> _
Public Property FitMaxHeight As Boolean = True
<Category("Printing Appearance"), Description("شكل الإطار الخارجي")> _
Public Property Border() As DashStyle = DashStyle.Solid
<Category("Printing Appearance"), Description("سُمك الإطار الخارجي")> _
Public Property BorderSize() As Integer = 0
<Category("Printing Appearance"), Description("لون الإطار الخارجي")> _
Public Property BorderColor() As Color = Color.Black
#End Region
#Region "Printing Data"
Private _SourceControl As Label
<Browsable(False)> _
Public Property SourceControl As System.Windows.Forms.Control Implements IPrintableControl.SourceControl
Get
If _SourceControl Is Nothing Then
_SourceControl = Me
End If
Return _SourceControl
End Get
Set(ByVal value As System.Windows.Forms.Control)
_SourceControl = value
End Set
End Property
<Category("Appearance"), Description("تحديد ما إذا كان الحقل لعرض رقم الصفحة، استخدم خاصية النص للتنسيق ,[pn]=Page Number, [pc]=Page Count")> _
Public Property IsPageNumber As Boolean = False
#End Region
#Region "Printing Components"
Dim _Printer As LabelPrinter
<Browsable(False)> _
Public ReadOnly Property Printer As Printer Implements IPrintableControl.Printer
Get
If _Printer Is Nothing Then
_Printer = New LabelPrinter(Me)
End If
Return _Printer
End Get
End Property
<Browsable(False)> _
Public ReadOnly Property Section As Section Implements IPrintableControl.Section
Get
Return CType(Me.Parent, Section)
End Get
End Property
#End Region
#Region "Printing Behavior"
<Category("Printing Behavior"), Description("تفعيل مقياس الرسم الأفقي")> _
Public Property ScaleHorizontal As Boolean = True Implements IPrintableControl.ScaleHorizontal
<Category("Printing Behavior"), Description("تفعيل مقياس الرسم الرأسي")> _
Public Property ScaleVertical As Boolean = True Implements IPrintableControl.ScaleVertical
<Category("Printing Behavior"), Description("رتبة مرحلة الطباعة")> _
Public Property StageIndex As Integer Implements IPrintableControl.StageIndex
<Category("Printing Behavior"), Description("رتبة الأداة أثناء مرحلة الطباعة")> _
Public Property PrintIndex As Integer Implements IPrintableControl.PrintIndex
<Category("Printing Behavior"), Description("تحديد ما إذا كانت الأداة تستكمل طباعتها في صفحات تالية أو لا")> _
Public Property OnePageOnly As Boolean = False Implements IPrintableControl.OnePageOnly
#End Region
#Region " Rotation Angle"
<Description("Rotation Angle"), Category("Appearance")> _
Public Property RotationAngle() As Double
Get
Return mRotationAngle
End Get
Set(ByVal value As Double)
mRotationAngle = value
MyBase.Invalidate() 'Force a redraw when the angle is changed
End Set
End Property
#End Region
#Region "Display Text"
<Description("Display Text"), Category("Appearance")> _
Public Overrides Property Text() As String
'we override the text property so we can force a redraw
Get
Return mText
End Get
Set(ByVal value As String)
mText = value
MyBase.Invalidate()
End Set
End Property
#End Region
#End Region
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
Dim graphics As Graphics = e.Graphics
Dim stringFormat As StringFormat = New StringFormat
stringFormat.Alignment = StringAlignment.Center
stringFormat.Trimming = StringTrimming.None
Dim textBrush As Brush = New SolidBrush(MyBase.ForeColor)
'Getting the width and height of the text, which we are going to write
Dim width As Double = graphics.MeasureString(Text, MyBase.Font).Width
Dim height As Double = graphics.MeasureString(Text, MyBase.Font).Height
'For rotation, you need to convert to radians
Dim angle As Double = (RotationAngle / 180) * Math.PI
graphics.TranslateTransform( _
(ClientRectangle.Width + CDbl(height * Math.Sin(angle)) - CDbl(width * Math.Cos(angle))) / 2, _
(ClientRectangle.Height - CDbl(height * Math.Cos(angle)) - CDbl(width * Math.Sin(angle))) / 2)
graphics.RotateTransform(CDbl(RotationAngle))
graphics.DrawString(Text, MyBase.Font, textBrush, 0, 0)
graphics.ResetTransform()
End Sub
#Region "Methods"
Protected Overrides Sub OnParentChanged(ByVal e As System.EventArgs)
If Me.Parent IsNot Nothing Then
If Not TypeOf Parent Is Section Then
Me.Parent.Controls.Remove(Me)
End If
End If
End Sub
Sub ChangeText()
End Sub
#End Region
End Class[/align][align=left]Dim direction As New StringFormat(StringFormatFlags.DirectionVertical)
....
....
g.DrawString(CurText, txt.Font, New SolidBrush(txt.ForeColor), Rec, direction) [/align]