I have a DevExpress chart control (although it may as well be a standard control…), when I set the cursor on MouseMove, although the correct line is being hit when I expect it to be the cursor isn’t changing. The cursor is not being set from anywhere else, is it possible that the form or something else is overriding my setting somehow without any code from me?
Here is my MouseMove event; it’s a little different as I only want the cursor to change in very specific scenarios:
private void ChartOnMouseMove(object sender, MouseEventArgs eventArgs)
{
var chartControl = sender as ChartControl;
var hitInformation = chartEffect.CalcHitInfo((eventArgs).X, (eventArgs).Y);
if (effectDataTable != null && effectDataTable .Columns.Count > 0 && effectDataTable .Columns.Contains("Player") && (hitInformation.InSeries || hitInformation.InSeriesLabel || hitInformation.InSeriesTitle))
{
chartControl .Cursor = Cursors.Default;
}
else
{
chartControl .Cursor = Cursors.Hand;
}
}
I’m using Visual Studio 2012 beta & .NET 4, could it be a quirk in that? I’ve never seen this behavior before, and I’m hoping one of you has!
I ended up reinstalling visual studio along with .NET and all of a sudden everything works as expected (no code changes). It’s an odd one, but thought I’d post the solution to my issue in case anyone else has the same issue…