How to disable zoom when Ctrl is pressed ?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
bsonnino
Newbie
Newbie
Posts: 2
Joined: Mon Jan 12, 2004 5:00 am

How to disable zoom when Ctrl is pressed ?

Post by bsonnino » Tue Mar 23, 2004 11:14 am

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

Pep
Site Admin
Site Admin
Posts: 3273
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Apr 15, 2004 2:37 pm

Hi Bruno,

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;

Post Reply