- a take the Responsive grid panel example from WebCore
- there are 4 labels and webedits, at run the labels are correctly allignet right on the begin of their controls
- I try to insert some controls programmatically, but the inserted labels are allignet left, see my experimental code below. The question is hove to achieve that inserted controls are in the same position as 4 above original labels.
my experimental code :
procedure TForm1.WebFormCreate(Sender: TObject);
var i: integer; edt: TWebEdit; lbl: TWebLabel;
begin
Self.Innerpanel.BeginUpdate;
for i := 0 to 9 do begin
lbl := TWebLabel.Create(Innerpanel);
lbl.Alignment := taLeftJustify;
lbl.Anchors := ;
lbl.AlignWithMargins := False;
lbl.AutoSize := True;
lbl.Caption := 'neco';
lbl.Layout := tlTop;
//// lbl.Name := 'xxx' + inttostr(i);
lbl.HeightStyle := ssAuto;
lbl.WidthStyle := ssAbsolute;
lbl.HTMLType := tLABELTAG;
// lbl.ElementClassName := lbClass;
lbl.ElementFont := efCss;
lbl.ElementPosition := epAbsolute;
lbl.EllipsisPosition := epNone;
lbl.Enabled := True;
// lbl.Assign(WebLabel1); even these not helps
Self.Innerpanel.AddControl(lbl);
edt := TWebEdit.Create(Innerpanel);
Self.Innerpanel.AddControl(edt);
end;
Self.Innerpanel.EndUpdate;
end;