Mouse wheel event

TeeChart for ActiveX, COM and ASP
Post Reply
dalshin
Newbie
Newbie
Posts: 8
Joined: Thu Dec 02, 2004 5:00 am
Contact:

Mouse wheel event

Post by dalshin » Wed Apr 21, 2010 6:49 pm

Hi,

Is it possible to catch mouse wheel event? If I can, I would like to use this event for zooming in and out rather than scrolling up and down.

dalshin

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Mouse wheel event

Post by Yeray » Thu Apr 22, 2010 10:59 am

Hi dalshin,

If you can catch the MouseWheel event in your IDE, you can catch it for the TeeChart control. For example, in VS2008:

Code: Select all

        private void InitializeChart()
        {            
            axTChart1.Aspect.View3D = false;

            axTChart1.AddSeries(TeeChart.ESeriesClass.scFastLine);
            axTChart1.Series(0).FillSampleValues(25);

            this.MouseWheel += new MouseEventHandler(Form1_MouseWheel);            
        }

        void Form1_MouseWheel(object sender, MouseEventArgs e)
        {
            axTChart1.Header.Caption = "mousewheel event";
            Rectangle rect = new Rectangle(axTChart1.Location.X, axTChart1.Location.Y, axTChart1.ChartBounds.Right-axTChart1.ChartBounds.Left,axTChart1.ChartBounds.Bottom-axTChart1.ChartBounds.Top);
            if (rect.Contains(e.X, e.Y))
            {
                axTChart1.Header.Caption = axTChart1.Header.Caption + " in chart";
            }
        }
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply