MouseHover Event

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
AGF
Newbie
Newbie
Posts: 34
Joined: Mon Feb 21, 2011 12:00 am

MouseHover Event

Post by AGF » Mon Jun 20, 2011 4:37 am

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

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: MouseHover Event

Post by Sandra » Mon Jun 20, 2011 9:11 am

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,
Best Regards,
Sandra Pazos / 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