不允许超出范围

procedure TfrmOffice.toolResize(Sender: TObject);
begin
  if Tool.Top < 23 then Tool.Top := 23;
  if Tool.Height > Screen.Height then
  begin
    Tool.Top := 23;
    Tool.Left := 1;
    Tool.Height := Screen.Height - 23;
  end;

  if Tool.Height > 30 then CurrHeight := Tool.Height;
  Too.Left := 3;
  Too.Top := 35;
  Too.Width := Tool.Width - 6;
  Too.Height := Tool.Height - 40;
  MoveUp.Left := Tool.Width - 20;
  if   Tool.Height  < 386  then   Tool.Height:= 386;
  if   Tool.Width   < 273  then   Tool.Width:= 273;

end;

你可能感兴趣的:(不允许超出范围)