Page 1 of 1
MouseHover Event
Posted: Mon Jun 20, 2011 4:37 am
by 15658604
Hi
Is it possible to use the MouseHover Event on different Parts of the TChat - like ClickAxis .... -> MouseHoverAxis Event.... or is the an workarround to modify TChart.MouseHover for the use with Axis etc. ?
<
Thanks
Re: MouseHover Event
Posted: Mon Jun 20, 2011 9:11 am
by 10050769
Hello AGF,
I have made a simple code where use MouseMove event and detected the Axis when mouse hover to axis:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private Steema.TeeChart.Styles.Bar bar1;
void InitializeChart()
{
bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
bar1.FillSampleValues();
tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);
}
void tChart1_MouseMove(object sender, MouseEventArgs e)
{
if (tChart1.Axes.Bottom.AxisRect().Contains(e.X, e.Y))
{
Text = "BottomAxes";
}
else if (tChart1.Axes.Left.AxisRect().Contains(e.X, e.Y))
{
Text = "LeftAxes";
}
}
Could you check if previous code works as you expected?
I hope will help.
Thanks,