Çeviri: Ramazan Gülbahar
Aşşağıdaki kodu kullanarak bütün Tbutton ların caption özelliğini çift satırlı hale getirebilirsiniz.
Kod: Tümünü seç
procedure SetMultiLineButton(AParent: TWinControl) ;
var
j : integer;
ah : THandle;
begin
for j := 0 to AParent.ControlCount - 1 do
if (AParent.Controls[j] is TButton) then
begin
ah := (AParent.Controls[j] as TButton).Handle;
SetWindowLong(ah, GWL_STYLE,
GetWindowLong(ah, GWL_STYLE) OR
BS_MULTILINE) ;
end;
end;
Form üzerine Button1 ve Button2 yerleştirin, Form üzerine bir TPanel ve üzerine Button3 ve Button4 yerleştirin.
SetMultiLineButton(Panel1)
Kodu ile Button3 ve Button4 çift satırlı Caption özelliğine sahip olacaktır.