直线与曲线控件

关于线控件的MSDN示例源码 :

1、LineBase


Namespace Microsoft.Samples
    
' Base class for the LineControls
    Public MustInherit Class LineBase
        
Inherits Control
        
Private ThicknessValue As Integer
        
Private IsAntiAliasValue As Boolean
        
Protected pen As pen

        
Public Sub New()
            InitializeComponent()
            SetStyle(ControlStyles.SupportsTransparentBackColor 
Or ControlStyles.ResizeRedraw, True)
            SetStyle(ControlStyles.Selectable, 
False)
            ThicknessValue 
= 1
            IsAntiAliasValue 
= True
            BackColor 
= Color.Transparent
        
End Sub


        
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
            
If disposing And Not (pen Is NothingThen
                pen.Dispose()
            
End If
            
MyBase.Dispose(disposing)
        
End Sub


        
Public Property AntiAlias() As Boolean
            
Get
                
Return IsAntiAliasValue
            
End Get
            
Set(ByVal Value As Boolean)
                IsAntiAliasValue 
= Value
                Invalidate()
            
End Set
        
End Property


        
Public Property Thickness() As Integer
            
Get
                
Return ThicknessValue
            
End Get
            
Set(ByVal Value As Integer)
                ThicknessValue 
= Value
                Invalidate()
            
End Set
        
End Property


        
Private Sub InitializeComponent()
            
Me.Name = "LineBase"
        
End Sub


        
Protected MustOverride Sub LineBase_Paint(ByVal sender As ObjectByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint '

    
End Class

End Namespace

 

2、StraightLine

Imports System.Drawing.Drawing2D

Namespace Microsoft.Samples
    
' StraightLine Control
    Public Class StraightLine
        
Inherits LineBase
        
Private myLineType As StraightLineTypes

        
Public Sub New()
            LineType 
= StraightLineTypes.Horizontal
        
End Sub


        
Public Property LineType() As StraightLineTypes
            
Get
                
Return myLineType
            
End Get
            
Set(ByVal Value As StraightLineTypes)
                myLineType 
= Value
                Invalidate()
            
End Set
        
End Property


        
Protected Overloads Overrides Sub LineBase_Paint(ByVal sender As ObjectByVal e As System.Windows.Forms.PaintEventArgs)
            Pen 
= New Pen(ForeColor, Thickness)

            
If AntiAlias Then
                e.Graphics.SmoothingMode 
= SmoothingMode.AntiAlias
            
End If

            
Select Case LineType
                
Case StraightLineTypes.Horizontal
                    DrawCenteredHorizontalLine(e.Graphics)
                
Case StraightLineTypes.Vertical
                    DrawCenteredVerticalLine(e.Graphics)
                
Case StraightLineTypes.DiagonalAscending
                    DrawCenteredDiagonalAscendingLine(e.Graphics)
                
Case StraightLineTypes.DiagonalDescending
                    DrawCenteredDiagonalDescendingLine(e.Graphics)
                
Case Else
            
End Select
        
End Sub


        
Private Sub DrawCenteredHorizontalLine(ByVal g As Graphics)
            
Dim i As Integer = Height / 2
            g.DrawLine(Pen, 
0, i, Width, i)
        
End Sub


        
Private Sub DrawCenteredVerticalLine(ByVal g As Graphics)
            
Dim i As Integer = Width / 2
            g.DrawLine(Pen, i, 
0, i, Height)
        
End Sub


        
Private Sub DrawCenteredDiagonalAscendingLine(ByVal g As Graphics)
            g.DrawLine(Pen, 
0, Height, Width, 0)
        
End Sub


        
Private Sub DrawCenteredDiagonalDescendingLine(ByVal g As Graphics)
            g.DrawLine(Pen, 
00, Width, Height)
        
End Sub

    
End Class

End Namespace

 

3、StraightLineTypeEditor

Imports System.Runtime.InteropServices
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Drawing.Design
Imports System.Windows.Forms.Design

Namespace Microsoft.Samples
    
<Editor("LineControls.Microsoft.Samples.StraightLineTypeEditor"GetType(UITypeEditor))> _
    
Public Enum StraightLineTypes
        Horizontal
        Vertical
        DiagonalDescending
        DiagonalAscending
    
End Enum

    
' Class used to provided the custom UITypeEditor
    Public Class StraightLineTypeEditor
        
Inherits UITypeEditor
        
Private lineTypeUI As StraightLineTypeUI

        
Public Overloads Overrides Function EditValue(ByVal context As ITypeDescriptorContext, ByVal provider As IServiceProvider, ByVal value As ObjectAs Object
            
Dim returnValue As Object = value
            
If Not (provider Is NothingThen
                
Dim edSvc As IWindowsFormsEditorService = CType(provider.GetService(GetType(IWindowsFormsEditorService)), IWindowsFormsEditorService)
                
If Not (edSvc Is NothingThen
                    
If lineTypeUI Is Nothing Then
                        lineTypeUI 
= New StraightLineTypeUI(Me)
                    
End If
                    lineTypeUI.Start(edSvc, value)
                    edSvc.DropDownControl(lineTypeUI)
                    value 
= lineTypeUI.MyValue
                    lineTypeUI.MyEnd()
                
End If
            
End If
            
Return value
        
End Function


        
Public Overloads Overrides Function GetEditStyle(ByVal context As ITypeDescriptorContext) As UITypeEditorEditStyle
            
Return UITypeEditorEditStyle.DropDown
        
End Function


        
Private Class StraightLineTypeUI
            
Inherits Control
            
Private edSvc As IWindowsFormsEditorService
            
Private editor As StraightLineTypeEditor = Nothing
            
Private oldLineType As StraightLineTypes
            
Private value As Object

            
Public Sub New(ByVal editor As StraightLineTypeEditor)
                
Me.editor = editor
                InitializeComponent()
            
End Sub


            
Public ReadOnly Property MyValue() As Object
                
Get
                    
Return value
                
End Get
            
End Property


            
Public Sub MyEnd()
                value 
= Nothing
                edSvc 
= Nothing
            
End Sub


            
Public Sub Start(ByVal edSvc As IWindowsFormsEditorService, ByVal value As Object)
                
Me.edSvc = edSvc
                
Me.value = value
                
Me.oldLineType = CType(value, StraightLineTypes)

                
Dim panel As Panel
                
Dim c As Control
                
For Each c In Controls
                    panel 
= c
                    
If Not (c Is NothingThen
                        c.BackColor 
= SystemColors.Control
                        c.ForeColor 
= SystemColors.ControlText
                    
End If
                    panel 
= Nothing
                
Next c

                
Select Case CType(value, StraightLineTypes)
                    
Case StraightLineTypes.Horizontal
                        
Me.horizontalPanel.BackColor = SystemColors.ControlText
                        
Me.horizontalPanel.ForeColor = SystemColors.Control
                    
Case StraightLineTypes.Vertical
                        
Me.verticalPanel.BackColor = SystemColors.ControlText
                        
Me.verticalPanel.ForeColor = SystemColors.Control
                    
Case StraightLineTypes.DiagonalAscending
                        
Me.diagonalAscendingPanel.BackColor = SystemColors.ControlText
                        
Me.diagonalAscendingPanel.ForeColor = SystemColors.Control
                    
Case StraightLineTypes.DiagonalDescending
                        
Me.diagonalDescendingPanel.BackColor = SystemColors.ControlText
                        
Me.diagonalDescendingPanel.ForeColor = SystemColors.Control
                    
Case Else
                
End Select
            
End Sub


            
Private Sub Teardown(ByVal save As Boolean)
                
If Not save Then
                    value 
= oldLineType
                
End If
                edSvc.CloseDropDown()
            
End Sub


            
Friend WithEvents horizontalPanel As System.Windows.Forms.Panel
            
Friend WithEvents verticalPanel As System.Windows.Forms.Panel
            
Friend WithEvents diagonalDescendingPanel As System.Windows.Forms.Panel
            
Friend WithEvents diagonalAscendingPanel As System.Windows.Forms.Panel
            
Friend WithEvents horizontalLine As Microsoft.Samples.StraightLine
            
Friend WithEvents verticalLine As Microsoft.Samples.StraightLine
            
Friend WithEvents diagonalDescendingLine As Microsoft.Samples.StraightLine
            
Friend WithEvents diagonalAscendingLine As Microsoft.Samples.StraightLine

            
Friend Sub InitializeComponent()
                
Me.horizontalPanel = New System.Windows.Forms.Panel()
                
Me.verticalPanel = New System.Windows.Forms.Panel()
                
Me.diagonalDescendingPanel = New System.Windows.Forms.Panel()
                
Me.diagonalAscendingPanel = New System.Windows.Forms.Panel()
                
Me.horizontalLine = New Microsoft.Samples.StraightLine()
                
Me.verticalLine = New Microsoft.Samples.StraightLine()
                
Me.diagonalDescendingLine = New Microsoft.Samples.StraightLine()
                
Me.diagonalAscendingLine = New Microsoft.Samples.StraightLine()
                
Me.horizontalPanel.SuspendLayout()
                
Me.verticalPanel.SuspendLayout()
                
Me.diagonalDescendingPanel.SuspendLayout()
                
Me.diagonalAscendingPanel.SuspendLayout()
                
Me.SuspendLayout()
                
' 
                ' horizontalPanel
                ' 
                Me.horizontalPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
                
Me.horizontalPanel.Controls.AddRange(New System.Windows.Forms.Control() {Me.horizontalLine})
                
Me.horizontalPanel.Location = New System.Drawing.Point(22)
                
Me.horizontalPanel.Name = "horizontalPanel"
                
Me.horizontalPanel.Size = New System.Drawing.Size(4040)
                
Me.horizontalPanel.TabIndex = 0
                
' 
                ' verticalPanel
                ' 
                Me.verticalPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
                
Me.verticalPanel.Controls.AddRange(New System.Windows.Forms.Control() {Me.verticalLine})
                
Me.verticalPanel.Location = New System.Drawing.Point(442)
                
Me.verticalPanel.Name = "verticalPanel"
                
Me.verticalPanel.Size = New System.Drawing.Size(4040)
                
Me.verticalPanel.TabIndex = 1
                
' 
                ' diagonalDescendingPanel
                ' 
                Me.diagonalDescendingPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
                
Me.diagonalDescendingPanel.Controls.AddRange(New System.Windows.Forms.Control() {Me.diagonalDescendingLine})
                
Me.diagonalDescendingPanel.Location = New System.Drawing.Point(862)
                
Me.diagonalDescendingPanel.Name = "diagonalDescendingPanel"
                
Me.diagonalDescendingPanel.Size = New System.Drawing.Size(4040)
                
Me.diagonalDescendingPanel.TabIndex = 2
                
' 
                ' diagonalAscendingPanel
                ' 
                Me.diagonalAscendingPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
                
Me.diagonalAscendingPanel.Controls.AddRange(New System.Windows.Forms.Control() {Me.diagonalAscendingLine})
                
Me.diagonalAscendingPanel.Location = New System.Drawing.Point(1282)
                
Me.diagonalAscendingPanel.Name = "diagonalAscendingPanel"
                
Me.diagonalAscendingPanel.Size = New System.Drawing.Size(4040)
                
Me.diagonalAscendingPanel.TabIndex = 3
                
' 
                ' horizontalLine
                ' 
                Me.horizontalLine.Dock = System.Windows.Forms.DockStyle.Fill
                
Me.horizontalLine.LineType = Microsoft.Samples.StraightLineTypes.Horizontal
                
Me.horizontalLine.Name = "horizontalLine"
                
Me.horizontalLine.Size = New System.Drawing.Size(3838)
                
Me.horizontalLine.TabIndex = 0
                
Me.horizontalLine.Text = "straightLine1"
                
' 
                ' verticalLine
                ' 
                Me.verticalLine.Dock = System.Windows.Forms.DockStyle.Fill
                
Me.verticalLine.LineType = Microsoft.Samples.StraightLineTypes.Vertical
                
Me.verticalLine.Name = "verticalLine"
                
Me.verticalLine.Size = New System.Drawing.Size(3838)
                
Me.verticalLine.TabIndex = 0
                
Me.verticalLine.Text = "straightLine2"
                
' 
                ' diagonalDescendingLine
                ' 
                Me.diagonalDescendingLine.Dock = System.Windows.Forms.DockStyle.Fill
                
Me.diagonalDescendingLine.LineType = Microsoft.Samples.StraightLineTypes.DiagonalDescending
                
Me.diagonalDescendingLine.Name = "diagonalDescendingLine"
                
Me.diagonalDescendingLine.Size = New System.Drawing.Size(3838)
                
Me.diagonalDescendingLine.TabIndex = 0
                
Me.diagonalDescendingLine.Text = "straightLine3"
                
' 
                ' diagonalAscendingLine
                ' 
                Me.diagonalAscendingLine.Dock = System.Windows.Forms.DockStyle.Fill
                
Me.diagonalAscendingLine.LineType = Microsoft.Samples.StraightLineTypes.DiagonalAscending
                
Me.diagonalAscendingLine.Name = "diagonalAscendingLine"
                
Me.diagonalAscendingLine.Size = New System.Drawing.Size(3838)
                
Me.diagonalAscendingLine.TabIndex = 0
                
Me.diagonalAscendingLine.Text = "straightLine4"
                
' 
                ' UserControl1
                ' 
                Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.diagonalAscendingPanel, Me.diagonalDescendingPanel, Me.verticalPanel, Me.horizontalPanel})
                
Me.Name = "UserControl1"
                
Me.Size = New System.Drawing.Size(16444)
                
Me.BackColor = System.Drawing.SystemColors.InactiveBorder
                
Me.horizontalPanel.ResumeLayout(False)
                
Me.verticalPanel.ResumeLayout(False)
                
Me.diagonalDescendingPanel.ResumeLayout(False)
                
Me.diagonalAscendingPanel.ResumeLayout(False)
                
Me.ResumeLayout(False)
            
End Sub


            
Private Sub button_Click(ByVal sender As ObjectByVal e As System.EventArgs) Handles horizontalLine.Click, verticalLine.Click, diagonalDescendingLine.Click, diagonalAscendingLine.Click '
                Dim line As StraightLine = sender

                
If Not (line Is NothingThen
                    
Me.value = line.LineType
                    Teardown(
True)
                
End If
            
End Sub

        
End Class

    
End Class

End Namespace

 

4、CurvedLine

Imports System.Drawing.Drawing2D

Namespace Microsoft.Samples
    
' CurvedLine Control
    Public Class CurvedLine
        
Inherits LineBase
        
Private curveTypeTemp As CurvedLineTypes

        
Public Sub New()
            CurveType 
= CurvedLineTypes.LowerRightQuarterCircle
        
End Sub


        
Public Property CurveType() As CurvedLineTypes
            
Get
                
Return curveTypeTemp
            
End Get
            
Set(ByVal Value As CurvedLineTypes)
                curveTypeTemp 
= Value
                Invalidate()
            
End Set
        
End Property


        
Protected Overrides Sub LineBase_Paint(ByVal sender As ObjectByVal e As System.Windows.Forms.PaintEventArgs)
            
Dim doubleWidth As Integer = Width * 2
            
Dim doubleHeight As Integer = Height * 2
            
Dim bounds As New Rectangle(00, Width * 2, Height * 2)
            bounds.Inflate(
-Thickness / 2-Thickness / 2)
            Pen 
= New Pen(ForeColor, Thickness)

            
If AntiAlias Then
                e.Graphics.SmoothingMode 
= SmoothingMode.AntiAlias
            
End If

            
Select Case CurveType
                
Case CurvedLineTypes.UpperLeftQuarterCircle
                    e.Graphics.DrawArc(Pen, bounds, 
180.0F, 90.0F)
                
Case CurvedLineTypes.UpperRightQuarterCircle
                    bounds.Offset(
-Width, 0)
                    e.Graphics.DrawArc(Pen, bounds, 
270.0F, 90.0F)
                
Case CurvedLineTypes.LowerLeftQuarterCircle
                    bounds.Offset(
0-Height)
                    e.Graphics.DrawArc(Pen, bounds, 
90.0F, 90.0F)
                
Case CurvedLineTypes.LowerRightQuarterCircle
                    bounds.Offset(
-Width, -Height)
                    e.Graphics.DrawArc(Pen, bounds, 
090)

                
Case Else
            
End Select
        
End Sub

    
End Class

End Namespace

 

5、CurvedLineTypeEditor

Imports System.Runtime.InteropServices
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Drawing.Design
Imports System.Windows.Forms.Design

Namespace Microsoft.Samples
    
<Editor("LineControls.Microsoft.Samples.CurvedLineTypeEditor"GetType(UITypeEditor))> _
    
Public Enum CurvedLineTypes
        LowerLeftQuarterCircle
        LowerRightQuarterCircle
        UpperLeftQuarterCircle
        UpperRightQuarterCircle
    
End Enum

    
' Class used to provided the custom UITypeEditor
    Public Class CurvedLineTypeEditor
        
Inherits UITypeEditor
        
Private lineTypeUI As CurvedLineTypeUI

        
Public Overloads Overrides Function EditValue(ByVal context As ITypeDescriptorContext, ByVal provider As IServiceProvider, ByVal value As ObjectAs Object
            
Dim returnValue As Object = value
            
If Not (provider Is NothingThen
                
Dim edSvc As IWindowsFormsEditorService = CType(provider.GetService(GetType(IWindowsFormsEditorService)), IWindowsFormsEditorService)
                
If Not (edSvc Is NothingThen
                    
If lineTypeUI Is Nothing Then
                        lineTypeUI 
= New CurvedLineTypeUI(Me)
                    
End If
                    lineTypeUI.Start(edSvc, value)
                    edSvc.DropDownControl(lineTypeUI)
                    value 
= lineTypeUI.MyValue
                    lineTypeUI.MyEnd()
                
End If
            
End If
            
Return value
        
End Function


        
Public Overloads Overrides Function GetEditStyle(ByVal context As ITypeDescriptorContext) As UITypeEditorEditStyle
            
Return UITypeEditorEditStyle.DropDown
        
End Function


        
Private Class CurvedLineTypeUI
            
Inherits Control
            
Private edSvc As IWindowsFormsEditorService
            
Private editor As CurvedLineTypeEditor = Nothing
            
Private oldLineType As CurvedLineTypes
            
Private value As Object


            
Public Sub New(ByVal editor As CurvedLineTypeEditor)
                
Me.editor = editor
                InitializeComponent()
            
End Sub


            
Public ReadOnly Property MyValue() As Object
                
Get
                    
Return value
                
End Get
            
End Property


            
Public Sub MyEnd()
                value 
= Nothing
                edSvc 
= Nothing
            
End Sub


            
Public Sub Start(ByVal edSvc As IWindowsFormsEditorService, ByVal value As Object)
                
Me.edSvc = edSvc
                
Me.value = value
                
Me.oldLineType = CType(value, CurvedLineTypes)

                
Dim panel As Panel
                
Dim c As Control
                
For Each c In Controls
                    panel 
= c
                    
If Not (c Is NothingThen
                        c.BackColor 
= SystemColors.Control
                        c.ForeColor 
= SystemColors.ControlText
                    
End If
                    panel 
= Nothing
                
Next c

                
Select Case CType(value, CurvedLineTypes)
                    
Case CurvedLineTypes.UpperLeftQuarterCircle
                        
Me.upperLeftPanel.BackColor = SystemColors.ControlText
                        
Me.upperLeftPanel.ForeColor = SystemColors.Control
                    
Case CurvedLineTypes.UpperRightQuarterCircle
                        
Me.upperRightPanel.BackColor = SystemColors.ControlText
                        
Me.upperRightPanel.ForeColor = SystemColors.Control
                    
Case CurvedLineTypes.LowerLeftQuarterCircle
                        
Me.lowerLeftPanel.BackColor = SystemColors.ControlText
                        
Me.lowerLeftPanel.ForeColor = SystemColors.Control
                    
Case CurvedLineTypes.LowerRightQuarterCircle
                        
Me.lowerRightPanel.BackColor = SystemColors.ControlText
                        
Me.lowerRightPanel.ForeColor = SystemColors.Control
                    
Case Else
                
End Select
            
End Sub


            
Private Sub Teardown(ByVal save As Boolean)
                
If Not save Then
                    value 
= oldLineType
                
End If
                edSvc.CloseDropDown()
            
End Sub


            
Friend WithEvents upperLeftPanel As System.Windows.Forms.Panel
            
Friend WithEvents upperRightPanel As System.Windows.Forms.Panel
            
Friend WithEvents lowerLeftPanel As System.Windows.Forms.Panel
            
Friend WithEvents lowerRightPanel As System.Windows.Forms.Panel
            
Friend WithEvents upperLeftLine As Microsoft.Samples.CurvedLine
            
Friend WithEvents upperRightLine As Microsoft.Samples.CurvedLine
            
Friend WithEvents lowerLeftLine As Microsoft.Samples.CurvedLine
            
Friend WithEvents lowerRighttLine As Microsoft.Samples.CurvedLine

            
Friend Sub InitializeComponent()
                
Me.upperLeftPanel = New System.Windows.Forms.Panel()
                
Me.upperRightPanel = New System.Windows.Forms.Panel()
                
Me.lowerLeftPanel = New System.Windows.Forms.Panel()
                
Me.lowerRightPanel = New System.Windows.Forms.Panel()
                
Me.upperLeftLine = New Microsoft.Samples.CurvedLine()
                
Me.upperRightLine = New Microsoft.Samples.CurvedLine()
                
Me.lowerLeftLine = New Microsoft.Samples.CurvedLine()
                
Me.lowerRighttLine = New Microsoft.Samples.CurvedLine()
                
Me.upperLeftPanel.SuspendLayout()
                
Me.upperRightPanel.SuspendLayout()
                
Me.lowerLeftPanel.SuspendLayout()
                
Me.lowerRightPanel.SuspendLayout()
                
Me.SuspendLayout()
                
' 
                ' upperLeftPanel
                ' 
                Me.upperLeftPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
                
Me.upperLeftPanel.Controls.AddRange(New System.Windows.Forms.Control() {Me.upperLeftLine})
                
Me.upperLeftPanel.Location = New System.Drawing.Point(22)
                
Me.upperLeftPanel.Name = "upperLeftPanel"
                
Me.upperLeftPanel.Size = New System.Drawing.Size(4040)
                
Me.upperLeftPanel.TabIndex = 0
                
' 
                ' upperRightPanel
                ' 
                Me.upperRightPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
                
Me.upperRightPanel.Controls.AddRange(New System.Windows.Forms.Control() {Me.upperRightLine})
                
Me.upperRightPanel.Location = New System.Drawing.Point(442)
                
Me.upperRightPanel.Name = "upperRightPanel"
                
Me.upperRightPanel.Size = New System.Drawing.Size(4040)
                
Me.upperRightPanel.TabIndex = 1
                
' 
                ' lowerLeftPanel
                ' 
                Me.lowerLeftPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
                
Me.lowerLeftPanel.Controls.AddRange(New System.Windows.Forms.Control() {Me.lowerLeftLine})
                
Me.lowerLeftPanel.Location = New System.Drawing.Point(862)
                
Me.lowerLeftPanel.Name = "lowerLeftPanel"
                
Me.lowerLeftPanel.Size = New System.Drawing.Size(4040)
                
Me.lowerLeftPanel.TabIndex = 2
                
' 
                ' lowerRightPanel
                ' 
                Me.lowerRightPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
                
Me.lowerRightPanel.Controls.AddRange(New System.Windows.Forms.Control() {Me.lowerRighttLine})
                
Me.lowerRightPanel.Location = New System.Drawing.Point(1282)
                
Me.lowerRightPanel.Name = "lowerRightPanel"
                
Me.lowerRightPanel.Size = New System.Drawing.Size(4040)
                
Me.lowerRightPanel.TabIndex = 3
                
' 
                ' upperLeftLine
                ' 
                Me.upperLeftLine.Dock = System.Windows.Forms.DockStyle.Fill
                
Me.upperLeftLine.CurveType = Microsoft.Samples.CurvedLineTypes.UpperLeftQuarterCircle
                
Me.upperLeftLine.Name = "upperLeftLine"
                
Me.upperLeftLine.Size = New System.Drawing.Size(3838)
                
Me.upperLeftLine.TabIndex = 0
                
Me.upperLeftLine.Text = "CurvedLine1"
                
' 
                ' upperRightLine
                ' 
                Me.upperRightLine.Dock = System.Windows.Forms.DockStyle.Fill
                
Me.upperRightLine.CurveType = Microsoft.Samples.CurvedLineTypes.UpperRightQuarterCircle
                
Me.upperRightLine.Name = "upperRightLine"
                
Me.upperRightLine.Size = New System.Drawing.Size(3838)
                
Me.upperRightLine.TabIndex = 0
                
Me.upperRightLine.Text = "CurvedLine2"
                
' 
                ' lowerLeftLine
                ' 
                Me.lowerLeftLine.Dock = System.Windows.Forms.DockStyle.Fill
                
Me.lowerLeftLine.CurveType = Microsoft.Samples.CurvedLineTypes.LowerLeftQuarterCircle
                
Me.lowerLeftLine.Name = "lowerLeftLine"
                
Me.lowerLeftLine.Size = New System.Drawing.Size(3838)
                
Me.lowerLeftLine.TabIndex = 0
                
Me.lowerLeftLine.Text = "CurvedLine3"
                
' 
                ' lowerRighttLine
                ' 
                Me.lowerRighttLine.Dock = System.Windows.Forms.DockStyle.Fill
                
Me.lowerRighttLine.CurveType = Microsoft.Samples.CurvedLineTypes.LowerRightQuarterCircle
                
Me.lowerRighttLine.Name = "lowerRighttLine"
                
Me.lowerRighttLine.Size = New System.Drawing.Size(3838)
                
Me.lowerRighttLine.TabIndex = 0
                
Me.lowerRighttLine.Text = "CurvedLine4"
                
' 
                ' UserControl1
                ' 
                Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.lowerRightPanel, Me.lowerLeftPanel, Me.upperRightPanel, Me.upperLeftPanel})
                
Me.Name = "UserControl1"
                
Me.Size = New System.Drawing.Size(16444)
                
Me.BackColor = System.Drawing.SystemColors.InactiveBorder
                
Me.upperLeftPanel.ResumeLayout(False)
                
Me.upperRightPanel.ResumeLayout(False)
                
Me.lowerLeftPanel.ResumeLayout(False)
                
Me.lowerRightPanel.ResumeLayout(False)
                
Me.ResumeLayout(False)

            
End Sub


            
Private Sub button_Click(ByVal sender As ObjectByVal e As System.EventArgs) Handles upperLeftLine.Click, upperRightLine.Click, lowerLeftLine.Click, lowerRighttLine.Click '
                Dim line As CurvedLine = sender
                
If Not (line Is NothingThen
                    
Me.value = line.CurveType
                    Teardown(
True)
                
End If
            
End Sub

        
End Class

    
End Class

End Namespace

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值