Unable to create a cycle of TButton size changes lazarus / 61-Beginners ---------------------------------------------------------------------- c0rbe · 2017-08-20 14:39 Im new to this but the logic seems right, would appreciate any help. I'm trying to make the Button get smaller twice and then finally return back to it's original size. procedure TForm1.Button1Click(Sender: TObject); begin           if Button1.tag = 0 then   begin     Button1.width := 200;     Button1.height := 45;     Button1.caption := 'Smaller Button';     Button1.tag := 1;   end;           if Button1.tag = 1 then   begin     Button1.width := 150;     Button1.height := 30;     Button1.caption := 'Even Smaller Button';     Button1.tag := 2;   end;           if Button1.tag = 2 then   begin     Button1.width := 280;     Button1.height := 64;     Button1.caption := 'Big Again';     Button1.tag := 0; end; Thanks in advance! ---------------------------------------------------------------------- howardpc · 2017-08-20 15:04 Try Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Button1Click(Sender: TObject);    procedure AlterButton(w, h, t: Integer; const aCaption: string);   begin     with Button1 do begin       SetBounds(Left, Top, w, h);       Tag:=t;       Caption:=aCaption;     end;   end; begin  with Button1 do begin    if AutoSize then      AutoSize:=False;    case Tag of      0: AlterButton(200, 45, 1, 'smaller button');      1: AlterButton(150, 30, 2, 'even smaller');      2: AlterButton(280, 64, 0, 'big again');    end;  end;end; ---------------------------------------------------------------------- c0rbe · 2017-08-20 15:07 Thank you very much!