Delphi Firemonkey组件样式don';如果在运行时创建,则无法工作
我的问题。 I在运行时创建Delphi Firemonkey组件样式don';如果在运行时创建,则无法工作,delphi,runtime,firemonkey,delphi-xe5,Delphi,Runtime,Firemonkey,Delphi Xe5,我的问题。 I在运行时创建TListBoxItem和TLabel。 创建了所有组件,但未应用TLabel样式 我是否必须调用任何其他函数才能应用样式 我的代码: // LIST ITEM LB_Item := TListBoxItem.Create(POSTAVKE); with LB_Item do begin Parent := POSTAVKE; Height := 50; Selectable := True; end; // LABEL 1 LB_Label1 := TLa
TListBoxItem
和TLabel
。
创建了所有组件,但未应用TLabel
样式
我是否必须调用任何其他函数才能应用样式
我的代码:
// LIST ITEM
LB_Item := TListBoxItem.Create(POSTAVKE);
with LB_Item do
begin
Parent := POSTAVKE;
Height := 50;
Selectable := True;
end;
// LABEL 1
LB_Label1 := TLabel.Create(nil);
with LB_Label1 do
begin
Parent := LB_Item;
Align := TAlignLayout.alLeft;
Width := 50;
Font.Size := 12;
TextAlign := TTextAlign.taCenter;
Text := IntToStr(Kolicina);
Font.Size := 14;
Font.Style := [TFontStyle.fsBold];
FontColor := TAlphaColorRec.Darkslategray;
HitTest := False;
end;
......
Application.ProcessMessages;
在运行时,您需要更改StyledSettings属性中的值:
StyledSettings := StyledSettings - [TStyledSetting.ssFamily, TStyledSetting.ssSize, TStyledSetting.ssStyle];
我应该为你做这件事
在运行时,您需要更改StyledSettings属性中的值:
StyledSettings := StyledSettings - [TStyledSetting.ssFamily, TStyledSetting.ssSize, TStyledSetting.ssStyle];
我应该为你做这件事