26-07-13, 07:47 PM
mostafa.vb كتب :اهلا {[b]أبورائد[/b]} هل يمكنك مساعدتى فى هذا الموضوع : اضغط هنا
السلام عليكم ورحمة الله وبركاته
شكراً لمرورك أخي الكريم وتم الرد في موضوعك
السلام عليكم ورحمة الله وبركاته
mostafa.vb كتب :اهلا {[b]أبورائد[/b]} هل يمكنك مساعدتى فى هذا الموضوع : اضغط هنا
@@أبورائد@@ كتب :
السلام عليكم ورحمة الله وبركاته
كانت هذه الأداة مخطط لها منذ أشهر تطويرها وبيعها لزيادة دخلي،
ولكن نزولا عند رغبة الأخوة الملحّة فقد تنازلت هذا الدخل.
وإن كان لدي وقت أقوم بشرح أجزاء الشفرة ليتم فهمها بشكل أسرع وأوضح.
السلام عليكم ورحمة الله وبركاته
ابو ابراهيم كتب :شكرا لكرمك اخي
أخي أبورائد
هل تجيز لي ان استخدم الاداة عن طيب خاطر منك
و والله لن استخدمها حتى تأذن لي
Private Sub SetDoubleBuffering(ByVal frm As Form, ByVal value As Boolean)
Dim p As System.Reflection.PropertyInfo = frm.GetType.GetProperty("DoubleBuffered", Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic)
p.SetValue(frm, value, Nothing)
End Sub
Public Structure RoundRectangle
#Region "Fields"
Private rec As Rectangle
Private d, d1, d2, d3, d4 As Integer
#End Region
#Region "Properties"
Public Property Rect() As Rectangle
Get
Return rec
End Get
Set(ByVal value As Rectangle)
rec = value
End Set
End Property
Public Property AllRadius() As Integer
Get
Return d
End Get
Set(ByVal value As Integer)
If value > 0 Then
d = value
d1 = d
d2 = d
d3 = d
d4 = d
Else
Throw New Exception("Radius must be greator than zero 0.")
End If
End Set
End Property
Public Property TopLeftRadius() As Integer
Get
Return d1
End Get
Set(ByVal value As Integer)
If value > 0 Then
d1 = value
Else
Throw New Exception("Radius must be greator than zero 0.")
End If
End Set
End Property
Public Property TopRightRadius() As Integer
Get
Return d2
End Get
Set(ByVal value As Integer)
If value > 0 Then
d2 = value
Else
Throw New Exception("Radius must be greator than zero 0.")
End If
End Set
End Property
Public Property BottomRightRadius() As Integer
Get
Return d3
End Get
Set(ByVal value As Integer)
If value > 0 Then
d1 = value
Else
Throw New Exception("Radius must be greator than zero 0.")
End If
End Set
End Property
Public Property BottomLeftRadius() As Integer
Get
Return d4
End Get
Set(ByVal value As Integer)
If value > 0 Then
d1 = value
Else
Throw New Exception("Radius must be greator than zero 0.")
End If
End Set
End Property
#End Region
#Region "Constructors"
Public Sub New(ByVal rect As Rectangle, ByVal AllRad As Integer)
If Not rect.IsEmpty Then
rec = rect
Else
Throw New Exception("parameter rect is an empty rectangle .")
End If
AllRadius = AllRad
End Sub
Public Sub New(ByVal rect As Rectangle, ByVal TopLeftRad As Integer, ByVal TopRightRad As Integer, ByVal BottomRightRad As Integer, ByVal BottomLeftRad As Integer)
If Not rect.IsEmpty Then
rec = rect
Else
Throw New Exception("parameter rect is an empty rectangle .")
End If
Me.d = -1
If TopLeftRad > 0 AndAlso TopRightRad > 0 AndAlso BottomRightRad > 0 AndAlso BottomLeftRad > 0 Then
Me.d1 = TopLeftRad
Me.d2 = TopRightRad
Me.d3 = BottomRightRad
Me.d4 = BottomLeftRad
Else
Throw New Exception("Radius must be greator than zero 0.")
End If
End Sub
#End Region
#Region "Functions"
Public Function GetPath() As GraphicsPath
Dim path As New GraphicsPath
If Me.AllRadius = 1 Then
path.AddRectangle(Me.Rect)
Else
Dim arcRect As Rectangle = New Rectangle(rec.Location, New Size(d1, d1))
path.AddArc(arcRect, 180, 90)
arcRect.X = rec.Right - d2
arcRect.Size = New Size(d2, d2)
path.AddArc(arcRect, 270, 90)
arcRect.X = rec.Right - d3
arcRect.Y = rec.Bottom - d3
arcRect.Size = New Size(d3, d3)
path.AddArc(arcRect, 0, 90)
arcRect.Y = rec.Bottom - d4
arcRect.X = rec.X
arcRect.Size = New Size(d4, d4)
path.AddArc(arcRect, 90, 90)
End If
path.CloseFigure()
Return path
End Function
Public Function IsTopNormal() As Boolean
Return (Me.TopLeftRadius + Me.TopRightRadius) \ 2 <= Me.rec.Width
End Function
Public Function IsLeftNormal() As Boolean
Return (Me.TopLeftRadius + Me.BottomLeftRadius) \ 2 <= Me.rec.Height
End Function
Public Function IsBottomNormal() As Boolean
Return (Me.BottomLeftRadius + Me.BottomRightRadius) \ 2 <= Me.rec.Width
End Function
Public Function IsRightNormal() As Boolean
Return (Me.BottomRightRadius + Me.TopRightRadius) \ 2 <= Me.rec.Height
End Function
Public Function IsNormal() As Boolean
Return Me.IsBottomNormal AndAlso Me.IsLeftNormal AndAlso Me.IsRightNormal AndAlso Me.IsTopNormal
End Function
Public Function GetMinimumNormalWidth() As Integer
Return Math.Max((Me.TopRightRadius + Me.TopLeftRadius) \ 2, (Me.BottomRightRadius + Me.BottomLeftRadius) \ 2)
End Function
Public Function GetMinimumNormalHeight() As Integer
Return Math.Max((Me.TopRightRadius + Me.BottomRightRadius) \ 2, (Me.TopLeftRadius + Me.BottomLeftRadius) \ 2)
End Function
Public Function GetMinimumNormalSize() As Size
Return New Size(Me.GetMinimumNormalWidth, Me.GetMinimumNormalHeight)
End Function
#End Region
End Structure
أبو يعقوب كتب :السلام عليكم
نظرت إلى الكود ووجدت أنك مبرمج جبار
ما إن نظرت إلى كلمة DoubleBuffering قلت في نفسي كيف سيفعلها والخاصية Protected (فقط الفئات المشتقة تراها) ولكنك اقتحمتها واجبرتها
@@أبورائد@@ كتب :
السلام عليكم ورحمة الله وبركاته
بارك الله أخي أبو ابراهيم
والله لقد أنزلت الشفرة المصدرية عن طيب خاطر فلتطمئن ويطمئن الجميع ولا تتحرّجوا
أرجو أن تستفيدوا منها وتصلحوا ما فيها من أخطاء وعيوب وتطوروها
أتنمى أرى إبداعات وأدوات أخرى من عاملنا الاسلامي العربي
السلام عليكم ورحمة الله وبركاته
إقتباس :الصراحة كانت هذه ستكون أول تجربة لي في مسألة البيع ولا أعرف حتى الطريقة.
ali.alfoly كتب :ممكن طريقة التركيب
وما هو اصدار مكتبة الفورم المستخدم
انا شغال بفيجوال 2012
واريد ادراجها فى مشروع يستخدم مكتبة فورم ورك 3.5