Mini Kabibi Habibi
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Namespace DevExpress.XtraCharts.Demos.Modules
Partial Public Class ChartDemoLine
Inherits DevExpress.XtraCharts.Demos.Modules.ChartDemoLineBase
Private WithEvents chartControl_Renamed As DevExpress.XtraCharts.ChartControl
Protected Overrides ReadOnly Property SeriesSelection() As Boolean
Get
Return True
End Get
End Property
Public Overrides ReadOnly Property ChartControl() As ChartControl
Get
Return Me.chartControl_Renamed
End Get
End Property
Public Sub New()
InitializeComponent()
End Sub
Protected Overrides Sub checkEditShowLabels_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
If seriesSelected IsNot Nothing AndAlso seriesSelected.Label IsNot Nothing Then
If checkEditShowLabels.Checked Then
seriesSelected.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True
Else
seriesSelected.LabelsVisibility = DevExpress.Utils.DefaultBoolean.False
End If
End If
UpdateControls()
End Sub
Private Sub chartControl_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles chartControl_Renamed.VisibleChanged
If chartControl_Renamed.Series.Count > 0 Then
chartControl_Renamed.SetObjectSelection(Me.chartControl_Renamed.Series(0))
End If
End Sub
Private ReadOnly Property IsLabelVisisble() As Boolean
Get
If seriesSelected IsNot Nothing AndAlso seriesSelected.Label IsNot Nothing AndAlso seriesSelected.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True Then
Return True
Else
Return False
End If
End Get
End Property
Public Overrides Sub UpdateControls()
MyBase.UpdateControls()
Dim view As LineSeriesView = Nothing
If seriesSelected IsNot Nothing Then
view = TryCast(seriesSelected.View, LineSeriesView)
End If
If view Is Nothing Then
checkEditShowLabels.Enabled = False
checkEditShowLabels.Checked = False
Return
End If
checkEditShowLabels.Enabled = True
checkEditShowLabels.Checked = IsLabelVisisble
End Sub
End Class
End Namespace