要重新加载一个CHECKBOX
UpdateStateIndexDisplay 晕找了好久总算找到了!~
谢谢两位了
procedure TFrmDp.chcktrDpMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
Node: TTreeNode;
i,SelectCount: Integer;
begin
Node := chcktrDp.GetNodeAt(x,y);
if (node <> nil) and (Button = mbLeft) and (ssLeft in Shift )then
begin
SelectCount := 0;
// for i := 0 to chcktrDp.Items.Count - 1 do
// begin
if chcktrDp.SelectionCount > 1 then Exit;
//;
chcktrDp.BeginDrag(True);
end;
end;
procedure TFrmDp.chcktrDpDragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
var
Node: TTreeNode;
begin
Node := chcktrDp.GetNodeAt(x,y);
if Node <> nil then
begin
Accept := True;
end;
end;
procedure TFrmDp.chcktrDpDragDrop(Sender, Source: TObject; X, Y: Integer);
var
Node: TTreeNode;
begin
Node := chcktrDp.GetNodeAt(x,y);
if Node <> nil then
begin
chcktrDp.Selected.MoveTo(node,naInsert);
chcktrDp.UpdateStateIndexDisplay(chcktrDp.Selected);
end;
end;