Hmm.. A bit of a pickle here... This for loop only seems to show the message (and do anything else) for the last component that's casted.. What could be causing this?
procedure TfrmMain.FormResize(Sender: TObject);
var
i: Integer;
tmp: WorkTimeRow.TfrmWorkTimeRow;
begin
for i := 0 to (scrlRows.ComponentCount-1) do
tmp := scrlRows.Components[i] as WorkTimeRow.TfrmWorkTimeRow;
ShowMessage(DateToStr(tmp.edtDate.Date));
tmp.Width:=scrlRows.ClientWidth;
tmp.FrameResize(Sender);
end;
scrlRows is a TScrollBox and WorkTimeRow.TfrmWorkTimeRow is a TFrame, for which I created a procedure called FrameResize to handle positioning some stuff around inside. I need to run this on all the frames inside the scrollbox, but as is, it only runs for the last one