TChart.Cursor: Cursor only updates when moving.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
arnadan
Newbie
Newbie
Posts: 5
Joined: Mon Sep 29, 2014 12:00 am

TChart.Cursor: Cursor only updates when moving.

Post by arnadan » Mon Nov 24, 2014 3:41 pm

My application dynamically has to change the Cursor of TChart. E.g. on a mouse down I want to change the cursor. But when I set a new cursor it is not immediately displayed in the TChart - the new changed cursor only show after I have moved the mouse. This is not what I would expect because other control show the changed mouse cursor immediately.

E.g.:
- Form with a Button and a TChart on it.
- A timer which calls this code:

Code: Select all

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (tChart1.Cursor == Cursors.Arrow)
            {
                tChart1.Cursor = Cursors.Cross;
                btnAdd.Cursor = Cursors.Cross;
            }
            else
            {
                tChart1.Cursor = Cursors.Arrow;
                btnAdd.Cursor = Cursors.Arrow;
            }
        }
- When the Cursor rests on the button it will change between Cross and Arrow periodically as exptected.
- When the Cursor rests on the TChart it will not change. Why?

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: TChart.Cursor: Cursor only updates when moving.

Post by Christopher » Tue Nov 25, 2014 11:12 am

arnadan wrote: - When the Cursor rests on the TChart it will not change. Why?
This is a defect which I have entered into the database with id=1020.

In the meantime, you can use a workaround similar to the following:

Code: Select all

    private void timer1_Tick(object sender, EventArgs e)
    {
      if (tChart1.Cursor == Cursors.Arrow)
      {
        tChart1.Cursor = Cursors.Cross;
        button1.Cursor = Cursors.Cross;
        if (tChart1.Parent.Bounds.Contains(Cursor.Position)) Cursor.Current = Cursors.Cross; //or equivalent
      }
      else
      {
        tChart1.Cursor = Cursors.Arrow;
        button1.Cursor = Cursors.Arrow;
        if (tChart1.Parent.Bounds.Contains(Cursor.Position)) Cursor.Current = Cursors.Arrow; //or equivalent
      }
    }
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply