Page 1 of 1

select control with right click mouse

Posted: Sun Oct 21, 2007 9:49 pm
by piet van Blokland
I have inserted several controls in my richvieweditor
If left click the control is selected and the resizing handles appear.
How to select the control when right click with the mouse?

Can you help me?

Piet van Blokland

Posted: Mon Oct 22, 2007 5:22 pm
by Sergey Tkachenko
Resizing handles appear when the control is selected.
That means you have code selecting controls on clicking.
If you used this demo as a sample: http://www.trichview.com/forums/viewtopic.php?t=157
this code is

Code: Select all

// This procedure is assigned to OnMouseDown of all inserted buttons
procedure TForm1.ControlMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  if Button = mbLeft then begin
    rve.SelectControl(TControl(Sender));
    ClickedControl := Sender;
    ClickPoint := Point(X, Y);
  end;
end;
Just change
Button = mbLeft
to
Button in [mbLeft, mbRight].