Cancelling Zoom in the middle of

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
glikoz
Newbie
Newbie
Posts: 50
Joined: Fri Oct 07, 2005 4:00 am

Cancelling Zoom in the middle of

Post by glikoz » Thu May 24, 2007 7:27 am

Could we cancel Zoom operation when user is in the middle of the Zoom operation..
I don't mention that AllowZoom=false

AllowZoom=true;
User started to make zoom
While user is making zoom user press "Esc" .
And i want to cancel operation .
Is it possible ?

Edu
Advanced
Posts: 206
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia

Post by Edu » Thu May 24, 2007 8:56 am

Hi Glikoz

You can try using "tChart1_KeyDown" and "tChart1_Zoomed" events. And with the Zoom.Active property, you can know if the user're doing a zoom. Your code can be something similar as below code:

Code: Select all

private bool cancelzoom = false;
        private void tChart1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape && tChart1.Zoom.Active)
                cancelzoom = true;
            else
                cancelzoom = false;
        }
        private void tChart1_Zoomed(object sender, EventArgs e)
        {
            if (cancelzoom)
                tChart1.Zoom.Undo();
            cancelzoom = false;
        }
Best Regards,
Edu

Steema Support Central
http://support.steema.com/

Post Reply