Panning Cursor style

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
matthbri
Newbie
Newbie
Posts: 43
Joined: Wed Mar 22, 2006 12:00 am

Panning Cursor style

Post by matthbri » Mon Jul 10, 2006 5:10 am

Is it possible to change the mouse cursro to 'Hand' while panning with the rmouse key? I tired with mouseup/mousedown etc. but it gets overriden.

thanks,

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Jul 10, 2006 8:12 am

Hi matthbri,

Yes, you can use something like this:

Code: Select all

    private Boolean IsScrolling = false;

    private void tChart1_MouseDown(object sender, MouseEventArgs e)
    {
      if (e.Button == MouseButtons.Right)
      {
        System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Hand;
        IsScrolling = true;
      }
      else
      {
        System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
        IsScrolling = false;
      }        
    }

    private void tChart1_MouseUp(object sender, MouseEventArgs e)
    {
      System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
      IsScrolling = false;
    }

    private void tChart1_MouseMove(object sender, MouseEventArgs e)
    {
      if (IsScrolling)
      {
        System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Hand;
      }
      else
      {
        System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
      }        
    }
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply