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 ?
Cancelling Zoom in the middle of
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:
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;
}