i would like to create a procedure on this.
procedure TForm1.Button1Click(Sender: TObject);
var
a: Array[0..1, 0..2] of TControl; // need to be pass
tmp: Array[0..1] of TControl;
i, j, iCnt : Integer;
begin
//-------------------------------------
a[0][0] := Panel1; //sample data inside the main panel
a[0][1] := Panel2;
a[0][2] := Panel3;
a[1][0] := Panel4;
a[1][1] := Panel5;
a[1][2] := Panel6;
//-------------------------------------
for i := low(a) to high(a) do
AutoSizeCtrlWidth(mainpanel, a[i], 20, 20);
for j := low(a[1]) to Hi开发者_如何学Gogh(a[1]) do
begin
for i := low(a) to high(a) do
tmp[i] := a[i][j];
AutoSizeCtrlHeight(mainpanel, tmp, 20,20);
end;
//
end;
Example:
procedure AutoSizeCtrlWidthHeight(AParentCtrl: TControl; arControls: Array of TControl; ASpacing, AMargin: Integer);
how to create a procedure having a parameter of two or multi dimensional array?
type
TMyDataType = array of array of integer;
procedure MyProcedure(const Data: TMyDataType);
begin
end;
精彩评论