unit Unit2;
interface
uses form_child;
type
TForm2 =
class(TForm)
RadioGroup1: TRadioGroup;
BitBtn1: TBitBtn;
cxTimeEdit1: TcxTimeEdit;
DateTimePicker1: TDateTimePicker;
JvTimeEdit1: TJvTimeEdit;
BitBtn2: TBitBtn;
Label1: TLabel;
btnCreateChild: TBitBtn;
BitBtn3: TBitBtn;
cxScrollbox: TcxScrollBox;
cxDBTimeEdit1: TcxDBTimeEdit;
Edit1: TEdit;
dxMemData1: TdxMemData;
dxMemData1time: TTimeField;
DataSource1: TDataSource;
dxLayoutControl1Group_Root: TdxLayoutGroup;
dxLayoutControl1: TdxLayoutControl;
dxLayoutItem1: TdxLayoutItem;
dxLayoutItem2: TdxLayoutItem;
dxLayoutGroup1: TdxLayoutGroup;
procedure cxButton1Click(Sender: TObject);
procedure btnCreateChildClick(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure cxDBTimeEdit1Enter(Sender: TObject);
private
{ Private declarations }
ChildArray:
array of Tfrm_Child;
ChildArraySize: integer;
ContainerActualWidth: integer;
ContainerActualHeigt: integer;
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
procedure TForm2.btnCreateChildClick(Sender: TObject);
begin
ChildArraySize := (ChildArraySize+1);
SetLength(ChildArray, ChildArraySize);
ChildArray[ChildArraySize-1] := Tfrm_child.Create(Form2);
ChildArray[ChildArraySize-1].Align := alLeft;
ChildArray[ChildArraySize-1].Parent := cxScrollbox;
ChildArray[ChildArraySize-1].AlignWithMargins := true;
ChildArray[ChildArraySize-1].pnlchild.Color := clRed;
ChildArray[ChildArraySize-1].pnlchild.Caption := '
ArrayINDEX ='+(ChildArraySize-1).ToString;
ChildArray[ChildArraySize-1].Show;
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
ChildArraySize := 0;
ContainerActualWidth := cxScrollbox.Width;
ContainerActualHeigt := cxScrollbox.Height;
end;