Profile Picture

Exception if switch chart cursor from custom to default

Posted By Syrhey Karol' Last Year
Author
Message
Syrhey Karol'
Posted Last Year
View Quick Profile
Forum Member

Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 21, Visits: 74
Hi!

Maybe I am doing something wrong.
I need to change the chart cursor from default to custom sometime.
I use INMouseService for that goal.
INMouseService _mouseService = (INMouseService)nChartControl1.View.GetServiceOfType(typeof(INMouseService));

I’ve managed to change cursor to a custom. But when I set cursor back to default I got exception.

I’ve attached a simple project to reproduce the exception.
Steps to reproduce:
1) Run the project. It has simple chart and 2 buttons in the toolbar: "Default Cursor" and "Custom Cursor".
"Default Cursor" button is checked by default.
2) Check "Custom Cursor" button and move cursor to the chart. You’ll see that cursor is changed to custom
3) Check "Default Cursor" button and move cursor to the chart. You’ll get “System.ObjectDisposedException: 'Cannot access a disposed object. Object name: 'Disposed 'Cursor' can no longer be used.'.'’ exception.

Could you help me in this situation, please?



Attachments
WinFormsApp1.zip (78 views, 9.00 KB)


Similar Topics


Reading This Topic