Q&A

  • 동적으로 판넬을 생성하고...
pMakeDynaminPanel함수가 동적으로 판넬을 생성하고

동적으로 생성된 판넬을 DbClick시 event를 pDLClick로 입력했습니다.

그런데 왜 showMessage가 발생하지 않는거죠?

이론상으론 아무 문제가 없는것 같은데.

뭐가 문젠지 가르쳐주세요.



procedure TfSim_Graph.pMakeDynaminPanel(iCnt : Integer);

Var

bev : TBevel;

i : Integer;

FirEmpty, InterEmpty : Integer;

Begin

iRact1_Left := (Panel2.Width - iCnt * 40) Div (iCnt+1);

InterEmpty := iRact1_Left;

For i := 1 To iCnt Do

Begin

alRactPanel1[i-1] := TMovePanel.Create(Panel2);

alRactPanel1[i-1].Parent := Panel2;

alRactPanel1[i-1].Height := 68;

alRactPanel1[i-1].Width := 40;

alRactpanel1[i-1].Top := 30;

alRactPanel1[i-1].Left := iRact1_Left;

alRactPanel1[i-1].Color := $00CAE2E8;

alRactPanel1[i-1].Name := ListBox3.Items.Strings[i-1];

alRactPanel1[i-1].OnClick := pClick;

alRactPanel1[i-1].OnDblClick := pDLClick; <-----------

alRactPanel1[i-1].OnMouseDown := PanelMouseDown;

alRactpanel1[i-1].OnMouseUp := PanelMouseUp;

alRactPanel1[i-1].OnMouseMove := PanelMouseMove;



bev := TBevel.Create(alRactpanel1[i-1]);

bev.Parent := alRactPanel1[i-1];

bev.Width := 2;

bev.Height := 24;

bev.Top := 43;

bev.Left := 19;

bev.Shape := bsLeftLine;

bev := TBevel.Create(alRactPanel1[i-1]);

bev.Parent := alRactPanel1[i-1];

bev.Width := 2;

bev.Height := 25;

bev.Top := 0;

bev.Left := 19;

bev.Shape := bsLeftLine;



iRact1_Left := (iRact1_Left + alRactPanel1[i-1].Width) + 8;



If (i Mod 10 ) = 0 Then

Begin

piRact1_Top := piRact1_Top+ 72;

iRact1_Left := 8;

End;

End;

End;



procedure TfSim_Graph.pDLClick(Sender: TObject);

Var Color : TColor;

i : Integer;

Begin

ShowMessage((Sender As TMovePanel).Caption);

End;

0  COMMENTS