I have a chart with Horizontal zoom enabled, but I want to do a special
funcion when the Ctrl key is pressed: I want the zoom lines to be drawn,
then I want to clear all points in the selected interval (this is done
setting color clNone to all points), but I dont want the chart to be zoomed.
When Ctrl is not pressed, I want the default behavior.
Is there a way to do it ?
Bruno
How to disable zoom when Ctrl is pressed ?
Hi Bruno,
a trick could be to check if Ctrl key is pressed in the OnMouseDown event :
a trick could be to check if Ctrl key is pressed in the OnMouseDown event :
Code: Select all
procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
{Check if CONTROL key is down}
Chart1.Zoom.Allow := (HiWord(GetKeyState(VK_CONTROL)) <> 0);
end;
Pep Jorge
http://support.steema.com
http://support.steema.com