Changing cursor shape in some teechart parts

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Verane
Newbie
Newbie
Posts: 23
Joined: Thu Jan 09, 2003 5:00 am

Changing cursor shape in some teechart parts

Post by Verane » Wed Jul 06, 2005 8:44 am

Hi,
I draw some rectangles directly on the chart canvas in the afterdraw event of my chart (using Graphics3D class).
I would need to change the cursor shape to cursors.hand when the mouse is over one of the rectangles.
Is it possible to do that, and how ?

Thanks by advance,
Verane.

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

Post by Narcís » Wed Jul 06, 2005 10:07 am

Hi Verane,

Yes, it is possbile. You should do something like this:

Code: Select all

		private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
		{
			g.Rectangle(Brushes.Purple, rect);
		}

		private void tChart1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
		{
			if(rect.Contains(e.X, e.Y)) 
				System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Hand;
			else
				System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
		}

		private Rectangle rect;

		private void Form1_Load(object sender, System.EventArgs e)
		{
			line1.FillSampleValues();
			rect = new Rectangle(100,100,100,100);
		}
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

Verane
Newbie
Newbie
Posts: 23
Joined: Thu Jan 09, 2003 5:00 am

Post by Verane » Wed Jul 06, 2005 1:20 pm

Thanks :D !

Post Reply