procedure TfrmMRD100.Proc_SetItemCreate(iCnt:integer);
var
i : integer;
begin
if SelITEM >= 0 then begin
arITEM[SelITEM].PNLMain.Color := clBtnFace;
end;
sclb_Grid.Visible := False;
SetLength(arITEM, iITEMCnt + iCnt);
i := iITEMCnt;
SelITEM := -1;
iITEMCnt := Length(arITEM);
while i < iITEMCnt do begin
Inc(i);
with arITEM[i - 1] do begin
/////////////////
// pl_Item 생성
PNLMain := TPanel.Create(sclb_Grid);
with PNLMain do begin
Align := alTop;
BevelInner := bvNone;
BevelOuter := bvRaised;
Ctl3D := False;
Caption := '';
ParentFont := True;
Height := 30;
Top := (i - 1) * 30;
Left := 0;
TabOrder := iITEMCnt;
TabStop := True;
Visible := True;
Parent := sclb_Grid;
Tag := i + 1;
// 이벤트 정의
OnClick := Proc_PNLClick;
OnEnter := Proc_PNLClick;
end;
///////////////////
// Txt_PPROD 생성
EdtCODE := TEdit.Create(PNLMain);
with EdtCODE do begin
Left := 20;
Top := 6;
Width := 100;
Height := 19;
Color := $00F0C89F;
Ctl3D := False;
ParentCtl3D := False;
ReadOnly := True;
TabOrder := 1;
TabStop := True;
Tag := i + 1;
Text := '';
Visible := True;
Parent := PNLMain;
// 이벤트 정의
OnChange := TxtCODEChange;
OnClick := TxtEnter;
OnEnter := TxtEnter;
OnExit := TxtCODEExit;
OnKeyDown := TxtKeyDown;
end;
///////////////////
// bt_PCODE 생성
BtnCODE := TSpeedButton.Create(PNLMain);
with BtnCODE do begin
Left := 120;
Top := 6;
Width := 19;
Height := 19;
Tag := i + 1;
Visible := False;
Parent := PNLMain;
Glyph := bt_PROD.Glyph;
// 이벤트 정의
OnClick := BTCODEClick;
end;
///////////////////
// Txt_PDESC 생성
EdtDESC := TEdit.Create(PNLMain);
with EdtDESC do begin
Left := 145;
Top := 6;
Width := 220;
Height := 19;
Color := $00E1FFFF;
Ctl3D := False;
ParentCtl3D := False;
ReadOnly := True;
TabOrder := 2;
TabStop := False;
Tag := i + 1;
Text := '';
Visible := True;
Parent := PNLMain;
// 이벤트 정의
OnClick := TxtROEnter;
OnEnter := TxtROEnter;
end;
///////////////////
// Txt_PDATE1 생성
EdtTDT1 := TMaskEdit.Create(PNLMain);
with EdtTDT1 do begin
Left := 405;
Top := 6;
Width := 120;
Height := 19;
Color := $00F0C89F;
Ctl3D := False;
EditMask := '9999-99-99;0;_';
ParentCtl3D := False;
ReadOnly := True;
TabOrder := 3;
TabStop := True;
Tag := i + 1;
Text := '';
Visible := True;
Parent := PNLMain;
// 이벤트 정의
OnClick := TxtEnter;
OnEnter := TxtEnter;
OnExit := TxtDATEExit;
OnKeyDown := TxtKeyDown;
end;
///////////////////
// Txt_PTATE2 생성
EdtTDT2 := TMaskEdit.Create(PNLMain);
with EdtTDT2 do begin
Left := 595;
Top := 6;
Width := 120;
Height := 19;
Color := $00F0C89F;
Ctl3D := False;
EditMask := '9999-99-99;0;_';
ParentCtl3D := False;
ReadOnly := True;
TabOrder := 4;
TabStop := True;
Tag := i + 1;
Text := '';
Visible := True;
Parent := PNLMain;
// 이벤트 정의
OnClick := TxtEnter;
OnEnter := TxtEnter;
OnExit := TxtDATEExit;
OnKeyDown := TxtKeyDown;
end;
///////////////////
// lb_DT_WV 생성
LbDT_WV := TLabel.Create(PNLMain);
with LbDT_WV do begin
Left := 555;
Top := 6;
Width := 10;
Height := 19;
AutoSize := False;
Caption := '~';
Tag := i + 1;
Visible := True;
Parent := PNLMain;
end;
///////////////////
// Txt_PTQTY 생성
EdtTQTY := TMaskEdit.Create(PNLMain);
with EdtTQTY do begin
Left := 755;
Top := 6;
Width := 120;
Height := 19;
Color := $00F0C89F;
Ctl3D := False;
EditMask := '';
ParentCtl3D := False;
ReadOnly := True;
TabOrder := 5;
TabStop := True;
Tag := i + 1;
Text := '';
Visible := True;
Parent := PNLMain;
// 이벤트 정의
OnClick := TxtEnter;
OnEnter := TxtEnter;
end;
참조하시길..
procedure TfrmMRD100.Proc_SetItemCreate(iCnt:integer);
var
i : integer;
begin
if SelITEM >= 0 then begin
arITEM[SelITEM].PNLMain.Color := clBtnFace;
end;
sclb_Grid.Visible := False;
SetLength(arITEM, iITEMCnt + iCnt);
i := iITEMCnt;
SelITEM := -1;
iITEMCnt := Length(arITEM);
while i < iITEMCnt do begin
Inc(i);
with arITEM[i - 1] do begin
/////////////////
// pl_Item 생성
PNLMain := TPanel.Create(sclb_Grid);
with PNLMain do begin
Align := alTop;
BevelInner := bvNone;
BevelOuter := bvRaised;
Ctl3D := False;
Caption := '';
ParentFont := True;
Height := 30;
Top := (i - 1) * 30;
Left := 0;
TabOrder := iITEMCnt;
TabStop := True;
Visible := True;
Parent := sclb_Grid;
Tag := i + 1;
// 이벤트 정의
OnClick := Proc_PNLClick;
OnEnter := Proc_PNLClick;
end;
///////////////////
// Txt_PPROD 생성
EdtCODE := TEdit.Create(PNLMain);
with EdtCODE do begin
Left := 20;
Top := 6;
Width := 100;
Height := 19;
Color := $00F0C89F;
Ctl3D := False;
ParentCtl3D := False;
ReadOnly := True;
TabOrder := 1;
TabStop := True;
Tag := i + 1;
Text := '';
Visible := True;
Parent := PNLMain;
// 이벤트 정의
OnChange := TxtCODEChange;
OnClick := TxtEnter;
OnEnter := TxtEnter;
OnExit := TxtCODEExit;
OnKeyDown := TxtKeyDown;
end;
///////////////////
// bt_PCODE 생성
BtnCODE := TSpeedButton.Create(PNLMain);
with BtnCODE do begin
Left := 120;
Top := 6;
Width := 19;
Height := 19;
Tag := i + 1;
Visible := False;
Parent := PNLMain;
Glyph := bt_PROD.Glyph;
// 이벤트 정의
OnClick := BTCODEClick;
end;
///////////////////
// Txt_PDESC 생성
EdtDESC := TEdit.Create(PNLMain);
with EdtDESC do begin
Left := 145;
Top := 6;
Width := 220;
Height := 19;
Color := $00E1FFFF;
Ctl3D := False;
ParentCtl3D := False;
ReadOnly := True;
TabOrder := 2;
TabStop := False;
Tag := i + 1;
Text := '';
Visible := True;
Parent := PNLMain;
// 이벤트 정의
OnClick := TxtROEnter;
OnEnter := TxtROEnter;
end;
///////////////////
// Txt_PDATE1 생성
EdtTDT1 := TMaskEdit.Create(PNLMain);
with EdtTDT1 do begin
Left := 405;
Top := 6;
Width := 120;
Height := 19;
Color := $00F0C89F;
Ctl3D := False;
EditMask := '9999-99-99;0;_';
ParentCtl3D := False;
ReadOnly := True;
TabOrder := 3;
TabStop := True;
Tag := i + 1;
Text := '';
Visible := True;
Parent := PNLMain;
// 이벤트 정의
OnClick := TxtEnter;
OnEnter := TxtEnter;
OnExit := TxtDATEExit;
OnKeyDown := TxtKeyDown;
end;
///////////////////
// Txt_PTATE2 생성
EdtTDT2 := TMaskEdit.Create(PNLMain);
with EdtTDT2 do begin
Left := 595;
Top := 6;
Width := 120;
Height := 19;
Color := $00F0C89F;
Ctl3D := False;
EditMask := '9999-99-99;0;_';
ParentCtl3D := False;
ReadOnly := True;
TabOrder := 4;
TabStop := True;
Tag := i + 1;
Text := '';
Visible := True;
Parent := PNLMain;
// 이벤트 정의
OnClick := TxtEnter;
OnEnter := TxtEnter;
OnExit := TxtDATEExit;
OnKeyDown := TxtKeyDown;
end;
///////////////////
// lb_DT_WV 생성
LbDT_WV := TLabel.Create(PNLMain);
with LbDT_WV do begin
Left := 555;
Top := 6;
Width := 10;
Height := 19;
AutoSize := False;
Caption := '~';
Tag := i + 1;
Visible := True;
Parent := PNLMain;
end;
///////////////////
// Txt_PTQTY 생성
EdtTQTY := TMaskEdit.Create(PNLMain);
with EdtTQTY do begin
Left := 755;
Top := 6;
Width := 120;
Height := 19;
Color := $00F0C89F;
Ctl3D := False;
EditMask := '';
ParentCtl3D := False;
ReadOnly := True;
TabOrder := 5;
TabStop := True;
Tag := i + 1;
Text := '';
Visible := True;
Parent := PNLMain;
// 이벤트 정의
OnClick := TxtEnter;
OnEnter := TxtEnter;
end;
end;
end;
sclb_Grid.Visible := True;
end;