我试图添加一个标签,按钮,编辑和按钮到一个gridPanelLayout。我不知道如果sizestyle自动将是最好的或不想测试它。我在运行时创建组件。因此,我尝试为每个组件集添加一个新行。但是我不知道如何将SizeStyle的属性设置为auto。我目前有GridpanelLayout1.RowCollection[i].SizeStyle := TsizeStyle.auto
,但它给出了错误,TSizeStyle是未声明的。
//add to grid
gridpanelLayout1.BeginUpdate;
if i <> 0 then
begin
GridpanelLayout1.rowcollection.Add;
GridpanelLayout1.RowCollection[i].SizeStyle := TsizeStyle.auto
end;
GridpanelLayout1.ControlCollection.Add;
GridpanelLayout1.ControlCollection[i].Column := 0;
GridpanelLayout1.controlCollection[i].Row := i;
GridpanelLayout1.ControlCollection[i].Control := (namelabel);
GridpanelLayout1.ControlCollection.Add;
GridpanelLayout1.ControlCollection[i].Column := 1;
GridpanelLayout1.controlCollection[i].Row := i;
GridpanelLayout1.ControlCollection[i].Control := (minusButton);
GridpanelLayout1.ControlCollection.Add;
GridpanelLayout1.ControlCollection[i].Column := 2;
GridpanelLayout1.controlCollection[i].Row := i;
GridpanelLayout1.ControlCollection[i].Control := (editfield);
GridpanelLayout1.ControlCollection.Add;
GridpanelLayout1.ControlCollection[i].Column := 3;
GridpanelLayout1.controlCollection[i].Row := i;
GridpanelLayout1.ControlCollection[i].Control := (Plusbutton);
GridpanelLayout1.EndUpdate;
1条答案
按热度按时间7ajki6be1#
TSizeStyle
是在TGridPanelLayout
类中声明的类型。要解决此问题,请将该行更改为