⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chartitem.vb

📁 使用Access数据库演示的任务分配管理程序 一个使用ADO.NET基于Microsoft Access数据库演示的任务分配管理的程序
💻 VB
字号:
' Properties of a single item in the chart.
Public Class ChartItem

#Region " Internal fields "

    ' Internal fields.
    Private m_Label As String
    Private m_Value As Integer
    Private m_Color As Color
    Private m_HighlightColor As Color
    Private m_Over As Boolean = False
    Private m_Expand As Boolean = False
    Private m_ExpandOffset As Point
    Private m_CenterPoint As Point
    Private m_StartPos As Single
    Private m_SweepSize As Single

#End Region

    ' Constructor.
    Public Sub New(ByVal Label As String, ByVal Value As Integer, ByVal Color As Color)
        Me.Label = Label
        Me.Value = Value
        Me.Color = Color
    End Sub

    ' Properties.
    Public Property Label() As String
        Get
            Return m_Label
        End Get
        Set(ByVal Value As String)
            m_Label = Value
        End Set
    End Property

    Public Property Value() As Integer
        Get
            Return m_Value
        End Get
        Set(ByVal Value As Integer)
            m_Value = Value
        End Set
    End Property

    Public Property Color() As Color
        Get
            Return m_Color
        End Get
        Set(ByVal Value As Color)
            m_Color = Value

            ' Create a lighter color for highlight that 
            ' is used later when drawing item.
            HighlightColor = Drawing.Color.FromArgb(255, _
                Math.Min(255, CInt(CSng(Value.R) * CSng(1.5))), _
                Math.Min(255, CInt(CSng(Value.G) * CSng(1.5))), _
                Math.Min(255, CInt(CSng(Value.B) * CSng(1.5))))
        End Set
    End Property

    ' Highlight color is used to gradient fill the item and 
    ' highlight when mouse-over.
    Public Property HighlightColor() As Color
        Get
            Return m_HighlightColor
        End Get
        Set(ByVal Value As Color)
            m_HighlightColor = Value
        End Set
    End Property

    ' Starting position of the item. This is relative to the chart type. 
    ' For example, this is degrees for pie chart and pixels for bar chart.
    Public Property StartPos() As Single
        Get
            Return m_StartPos
        End Get
        Set(ByVal Value As Single)
            m_StartPos = Value
        End Set
    End Property

    ' Size of the item. This is relative to the chart type. For example, 
    ' this is degrees for pie chart and pixels for bar chart.
    Public Property SweepSize() As Single
        Get
            Return m_SweepSize
        End Get
        Set(ByVal Value As Single)
            m_SweepSize = Value
        End Set
    End Property

    ' How far the chart item is expanded. For pie charts, this 
    ' depends where the item is positioned within the circle.
    Public Property ExpandOffset() As Point
        Get
            Return m_ExpandOffset
        End Get
        Set(ByVal Value As Point)
            m_ExpandOffset = Value
        End Set
    End Property

    ' Center to chart shape. Used when drawing labels.
    Public Property CenterPoint() As Point
        Get
            Return m_CenterPoint
        End Get
        Set(ByVal Value As Point)
            m_CenterPoint = Value
        End Set
    End Property

    ' If the chart item is expanded or not.
    Public Property IsExpanded() As Boolean
        Get
            Return m_Expand
        End Get
        Set(ByVal Value As Boolean)
            m_Expand = Value
        End Set
    End Property

    ' Internal properties. If the mouse is currently over the chart item.
    Friend Property IsOver() As Boolean
        Get
            Return m_Over
        End Get
        Set(ByVal Value As Boolean)
            m_Over = Value
        End Set
    End Property
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -