1

Iam trying to add a label, button , edit and button to a gridPanelLayout. I was not sure if sizestyle auto was going to be the best or not so wanted to test it. I make my components at runtime. So I am trying to add a new row for each SET of components. But I can not figure out how to set the property to auto for SizeStyle. I currently have GridpanelLayout1.RowCollection[i].SizeStyle := TsizeStyle.auto but it gives error that TSizeStyle is undeclared.

 //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 Answer 1

4

TSizeStyle is a type declared within the TGridPanelLayout class.

To fix the problem, change that line to read

GridpanelLayout1.RowCollection[i].SizeStyle := TGridPanelLayout.TsizeStyle.auto

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.