Set button multi-line caption

Posted in Components

You may use SetWindowLong function with BS_MULTILINE parameter to set multi line caption of some button.

procedure TForm1.Button1Click(Sender: TObject);
var
  TempButton: LongInt;
begin
  TempButton:=GetWindowLong(Button1.Handle, GWL_STYLE);
  SetWindowLong(Button1.Handle, GWL_STYLE, TempButton or BS_MULTILINE);
end;