Page 1 of 1

DrawLine event for deselecting?

Posted: Wed Oct 15, 2008 1:59 pm
by 14049416
Hi,

I have code where if a user selects a horizontal line it places a box over the right axis at that position and shows the price of where the line is currently placed. I do this using the Selecting event.

When I deselect the line I would like to remove the box so that it is no longer visible. How can I determine when the box is deselected?

Thanks,
Kevin

Posted: Wed Oct 15, 2008 2:24 pm
by narcis
Hi Kevin,

You can use MouseDown or MouseMove events for that. For example, if you are using an Annotation tool for displaying the box you can do this:

Code: Select all

		void tChart1_MouseDown(object sender, MouseEventArgs e)
		{			
			if (drawLine1.Clicked(e.X,e.Y) == null) //No line selected
			{
				annotation1.Active = false;		
			}
		}
Hope this helps!