تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[سؤال] تغيير الزوايا القائمة لرأس النموذج ؟
#8
اخيرا وجدت كلاس ممتازة على النت ...

اضفها

PHP كود :
Public Class RoundedRectangle
    
Public Enum RectangleCorners
        None 
0
        TopLeft 
1
        TopRight 
2
        BottomLeft 
4
        BottomRight 
8
        All 
TopLeft Or TopRight Or BottomLeft Or BottomRight
    End Enum

    
Public Shared Function Create(As IntegerAs Integerwidth As Integerheight As Integer_
 radius 
As Integercorners As RectangleCorners) As GraphicsPath
        Dim xw 
As Integer width
        Dim yh 
As Integer height
        Dim xwr 
As Integer xw radius
        Dim yhr 
As Integer yh radius
        Dim xr 
As Integer radius
        Dim yr 
As Integer radius
        Dim r2 
As Integer radius 2
        Dim xwr2 
As Integer xw r2
        Dim yhr2 
As Integer yh r2

        Dim p 
As New GraphicsPath()
        
p.StartFigure()

        
'Top Left Corner
        If (RectangleCorners.TopLeft And corners) = RectangleCorners.TopLeft Then
            p.AddArc(x, y, r2, r2, 180, 90)
        Else
            p.AddLine(x, yr, x, y)
            p.AddLine(x, y, xr, y)
        End If

        '
Top Edge
        p
.AddLine(xryxwry)

        
'Top Right Corner
        If (RectangleCorners.TopRight And corners) = RectangleCorners.TopRight Then
            p.AddArc(xwr2, y, r2, r2, 270, 90)
        Else
            p.AddLine(xwr, y, xw, y)
            p.AddLine(xw, y, xw, yr)
        End If

        '
Right Edge
        p
.AddLine(xwyrxwyhr)

        
'Bottom Right Corner
        If (RectangleCorners.BottomRight And corners) = RectangleCorners.BottomRight Then
            p.AddArc(xwr2, yhr2, r2, r2, 0, 90)
        Else
            p.AddLine(xw, yhr, xw, yh)
            p.AddLine(xw, yh, xwr, yh)
        End If

        '
Bottom Edge
        p
.AddLine(xwryhxryh)

        
'Bottom Left Corner
        If (RectangleCorners.BottomLeft And corners) = RectangleCorners.BottomLeft Then
            p.AddArc(x, yhr2, r2, r2, 90, 90)
        Else
            p.AddLine(xr, yh, x, yh)
            p.AddLine(x, yh, x, yhr)
        End If

        '
Left Edge
        p
.AddLine(xyhrxyr)

        
p.CloseFigure()
        Return 
p
    End 
Function

    Public 
Shared Function Create(rect As Rectangleradius As IntegerAs RectangleCorners) As GraphicsPath
        
Return Create(rect.Xrect.Yrect.Widthrect.Heightradiusc)
    
End Function

    Public 
Shared Function Create(As IntegerAs Integerwidth As Integerheight As Integerradius As Integer) As GraphicsPath
        
Return Create(xywidthheightradiusRectangleCorners.All)
    
End Function

    Public 
Shared Function Create(rect As Rectangleradius As Integer) As GraphicsPath
        
Return Create(rect.Xrect.Yrect.Widthrect.Heightradius)
    
End Function

    Public 
Shared Function Create(As IntegerAs Integerwidth As Integerheight As Integer) As GraphicsPath
        
Return Create(xywidthheight5)
    
End Function

    Public 
Shared Function Create(rect As Rectangle) As GraphicsPath
        
Return Create(rect.Xrect.Yrect.Widthrect.Height)
    
End Function
End Class 



ثم استخدم هذا الكود في حدث Load وسلامتك

PHP كود :
Dim path As GraphicsPath RoundedRectangle.Create(-1, -1Me.WidthMe.Height11)
Me.Region = New Region(path
الرد }}}
تم الشكر بواسطة: kafi2030 , aftfm


الردود في هذا الموضوع
RE: تغيير الزوايا القائمة لرأس النموذج ؟ - بواسطة الشاكي لله - 21-01-14, 01:24 AM

المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  [سؤال] تغيير الفورم الرئيسي عند تشغيل البرنامج في Visual Studio مع .NET 8؟ silverlord 2 653 09-03-25, 03:52 AM
آخر رد: silverlord
  [كود] كود تغيير حجم النص في التكست بوكس hassan 8 8,793 30-01-25, 02:33 AM
آخر رد: خالد كامل1
  تغيير أسم ملف DOX.1 3 3,267 01-01-25, 09:37 PM
آخر رد: anes
  تغيير مكان حفظ الصورة من قاعدة البيانات إلى مجلد في مسار البرنامج F.H.M 37 2,336 05-11-24, 08:30 AM
آخر رد: F.H.M
  تغيير اللون تلقائياً عند إقتراب نهاية العقد F.H.M 2 450 25-10-24, 07:16 AM
آخر رد: F.H.M
Question ممكن كود تغيير حجم Form بالكود الورد الصناعي 2 440 13-08-24, 10:10 AM
آخر رد: الورد الصناعي
  [سؤال] مشكلة في انشاء النموذج محمد العامر 3 465 14-06-24, 07:16 PM
آخر رد: أبو خالد الشكري
  طلب تغيير لون خلية بالجريد كنترول حسب شرط معين heem1986 0 360 13-06-24, 09:59 AM
آخر رد: heem1986
  تغيير المسار الي مسار البرنامج في تقرير ميكروسوفت atefkhalf2004 2 437 02-04-24, 05:05 PM
آخر رد: atefkhalf2004
  تغيير على كود الحفظ محمد خيري 6 582 28-03-24, 04:20 PM
آخر رد: محمد خيري

التنقل السريع :


يقوم بقرائة الموضوع: