Redimension controls at runtime  

Send By: Q3 Team
Web : http://www.q3.nu
Email: dlib@q3.nu
Date: 21/12/99

Tip accessed 624 times

 


It is enough with adding this code to the OnMouseMove event of the controls:


 procedure TForm1.Panel1MouseMove(Sender: TObject; Shift: TShiftState; X,
   Y: Integer);
 begin
    if Shift = [ssLeft]+[ssShift] then
    begin
      With Sender as TWinControl do
      begin
        Width:=X;
        Height:=Y;
      end;
    end;
 end;



And the user will be able to redimensionate the controls if he moves the mouse on the control maintaining pressed the shift of the keyboard and the left button of the mouse.