updating the cursor when the control or shift key is pressed

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
greggorob64
Posts: 183
Joined: Tue Mar 18, 2014 2:55 pm

updating the cursor when the control or shift key is pressed

Post by greggorob64 » Tue Oct 11, 2016 9:37 pm

In ViewXY I have the zoom settings as default (control is Y-only, Shift is X-only).

When you press either of the keys, i'd like the cursor icon to update to reflect that. However, the cursor update doesn't update until you move the mouse.

Is there any method or setting I can change to get the cursor to update immediately without the mousemove? I'd have to call it on shift\control keydown method.

Thanks!

ArctionKestutis
Posts: 552
Joined: Mon Mar 14, 2016 9:22 am

Re: updating the cursor when the control or shift key is pre

Post by ArctionKestutis » Wed Oct 12, 2016 7:47 am

You need to get Chart in focus. If you click on Chart once, cursor-icon will be updated without mouse movement. You could set focus, for example, in AfterRendering event handler:

Code: Select all

        private void _chart_AfterRendering(object sender, AfterRenderingEventArgs e)
        {
            if(_chart.CanFocus)
            {
                _chart.Focus();
                _chart.AfterRendering -= _chart_AfterRendering;
            }
        }

Post Reply