Page 1 of 1

Changing cursor shape in some teechart parts

Posted: Wed Jul 06, 2005 8:44 am
by 8576839
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.

Posted: Wed Jul 06, 2005 10:07 am
by narcis
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);
		}

Posted: Wed Jul 06, 2005 1:20 pm
by 8576839
Thanks :D !