Q&A

  • 질문제목과 분류를 꼭 해주시길 부탁드립니다.
procedure TForm_Data_Search.CheckListBox1DragDrop(Sender, Source: TObject; X, Y: Integer);

var

Value : integer;

Item_index : integer;

APoint : TPoint;



begin

if Sender = CheckListBox1 then

begin

APoint.X := X;

APoint.Y := Y;

Value := CheckListBox1.ItemAtPos(APoint, True);

if Value = -1 then

begin

CheckListBox1.Add(CheckListBox1.Items[CheckListBox1.ItemIndex]);

CheckListBox1.Items.Delete(CheckListBox1.ItemIndex);

end

else

begin

// drop된 곳의 위에 선택된(dop의 대상)을 넣는다

// 넣는 위치를 아래에 둘때 사용한다

CheckListBox1.Items.Insert(Value ,CheckListBox1.Items[CheckListBox1.ItemIndex]);

CheckListBox1.items.Delete(CheckListBox1.ItemIndex);

end;

end;

end;





procedure TForm_Data_Search.CheckListBox1DragOver(Sender,

Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);

begin

Accept := (Source = CheckListBox1);

end;





리스트 박스의 Properties 중에

Drugmode 를 dmAutomatic로 변경 시키면 이벤트 잘 탑니다...

0  COMMENTS