如题!

解决方案 »

  1.   

    不太明白你的意思
    我觉得在OnMouseMove里面而不是在OnClick里面写代码不久可以了吗?
      

  2.   

    我就是想在拖动的时候不触发click事件,有没有办法?还有,begindrag()放在什么事件里好些!
      

  3.   

    也就是说在listview中既有click事件(处理业务)
    又有mousedown事件(begindrag,开始拖)程序如何在拖的时候,不触发click事件,
      

  4.   

    implementation{$R *.DFM}procedure TForm1.ListBox1MouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer);beginif Button = mbLeft thenbeginListbox1.DragMode := dmManual;Listbox1.BeginDrag(False,-1);end;end;procedure TForm1.Label1DragDrop(Sender, Source: TObject; X, Y: Integer);beginif (Sender is TLabel) and (Source is TListBox) thenbeginwith Sender as Tlabel dobeginFont := (Source as Tlistbox).Font;Color := (Source as TlistBox).Color;Caption := (Source as TlistBox).Items[(Source as TlistBox).ItemIndex]end;end;end;procedure TForm1.Label1DragOver(Sender, Source: TObject; X, Y: Integer;State: TDragState; var Accept: Boolean);beginAccept := Source is TLIstBox;end;procedure TForm1.TreeView1DragOver(Sender, Source: TObject; X, Y: Integer;State: TDragState; var Accept: Boolean);beginAccept := Source is TLIstBox;end;procedure TForm1.TreeView1DragDrop(Sender, Source: TObject; X, Y: Integer);beginWith (Sender as TTreeView) dobeginGetNodeAt(X,Y).Text := (Source as TListBox).Items[(Source as TlistBox).ItemIndex];end;end;procedure TForm1.TreeView1DragDrop(Sender, Source: TObject; X, Y: Integer);beginWith (Sender as TTreeView) dobeginItemS.AddChild (GetNodeAt(X,Y),(Source as TListBox).Items[(Source as TlistBox).ItemIndex]);end;
      

  5.   

    47522341(睡到8:30) :
    我没看出怎么屏蔽了click事件那!