Nevron Forum

Setting the NChartControl.Cursor property appears to have no effect

https://www.nevron.com/Forum/Topic10757.aspx

By Lance Levendowski - Tuesday, May 17, 2016

Setting the NChartControl.Cursor property appears to have no effect when the mouse is moved over the control during runtime.

Run the following sample code to reproduce the issue.  Note that the NChartControl should use the Hand cursor, but it always uses the Default cursor.

Public Class CursorForm
  Inherits Windows.Forms.Form

  Private _ChartControl1 As Nevron.Chart.WinForm.NChartControl

  Public Sub New()
    MyBase.New()

    Me.Size = New Drawing.Size(640, 480)
    Me.StartPosition = FormStartPosition.CenterScreen

    Dim series As New Nevron.Chart.NBarSeries
    series.BarShape = Nevron.Chart.BarShape.Bar
    series.AddDataPoint(New Nevron.Chart.NDataPoint(3))
    series.AddDataPoint(New Nevron.Chart.NDataPoint(1))
    series.AddDataPoint(New Nevron.Chart.NDataPoint(2))
    series.AddDataPoint(New Nevron.Chart.NDataPoint(5))
    series.AddDataPoint(New Nevron.Chart.NDataPoint(4))

    Me._ChartControl1 = New Nevron.Chart.WinForm.NChartControl
    Me._ChartControl1.Dock = DockStyle.Fill
    Me._ChartControl1.Settings.RenderSurface = Nevron.GraphicsCore.RenderSurface.Window
    '
    'ISSUE: Setting the NChartControl.Cursor property appears to have no effect when the mouse is moved over the control during runtime.
    Me._ChartControl1.Cursor = Cursors.Hand
    '
    Me.Controls.Add(Me._ChartControl1)

    Dim chart As Nevron.Chart.NCartesianChart = DirectCast(Me._ChartControl1.Charts(0), Nevron.Chart.NCartesianChart)
    chart.Series.Add(series)
  End Sub

End Class

By Nevron Support - Wednesday, May 18, 2016

Hi Lance,

The Cursor property is not regarded as the control also needs to operate under WPF. The following code shows how to change the default cursor:

INMouseService mouseService = (INMouseService)nChartControl1.View.GetServiceOfType(typeof(INMouseService));           mouseService.DefaultCursor = Cursors.Cross;
By Lance Levendowski - Wednesday, May 18, 2016

Works perfect.  Thanks!