procedure TForm1.Button2Click(Sender: TObject); begin button1.Caption := 'hello' + #13 + 'Me'; SetWindowLong(button1.handle,Gwl_style,GetwindowLong(button1.handle,gwl_style) or bs_multiline); button1.Repaint; // if it is writed on formcreate, it needn't repaint. end;
Button1.Caption := '我'#13'换行了吗?';
BitBtn1.Caption := 'Line1'#13#10'Line2'#13#10;
end;
begin
button1.Caption := 'hello' + #13 + 'Me';
SetWindowLong(button1.handle,Gwl_style,GetwindowLong(button1.handle,gwl_style) or bs_multiline);
button1.Repaint; // if it is writed on formcreate, it needn't repaint.
end;