我现在要做一个程序,左边放Treeview,右边放ListView,ListView是Report形式,有一些记录,现在想从Listview中拖拽记录到左边的Treeview,并且在TreeView中判断是在哪个节点上,在哪个节点上,就在这个节点的下面添加该记录。
我没有作过类似的程序,紧急求救!
我没有作过类似的程序,紧急求救!
解决方案 »
- 利用webbrowser怎么获取或控制javascript doPostBack(ajax)回传页面中的元素
- vcl for the web与intraweb是什么关系,刚装了delphi2007架构师版,找不到intraweb了
- 使用UDP发送小文件一切正常,可是发送3M的好象就没有反映了????
- 不通过双击“关闭”按钮添加过程代码,直接在unit写过程代码,但是运行出问题了
- 继续加分,一直到解决为止!!!
- 怎样在stringgrid的cell中放入图片?
- 实现像VC++ 6.0 一样的命令行窗口
- delphi 捕捉 js事件问题,请大侠没帮帮忙!
- 请问哪个哥哥姐姐告诉我一些关于Delphi的网站!来者有分!
- 有没有好的电子书?
- 请教高人,如何在程序运行中动态给FastReport中的Memo控件赋值,急……在线等待!
- 请问高手:在DELPHI下如何用代码直接驱动打印机???
property OnDragDrop: TDragDropEvent;C++ syntax:typedef void __fastcall (__closure *TDragDropEvent)(System::TObject* Sender, System::TObject* Source, int X, int Y);
__property TDragDropEvent OnDragDrop = {read=FOnDragDrop, write=FOnDragDrop};DescriptionUse the OnDragDrop event handler to specify what happens when the user drops an object. The Source parameter of the OnDragDrop event is the object being dropped, and the Sender is the control the object is being dropped on. The X and Y parameters are the coordinates of the mouse positioned over the control
在ListView1DragOver,与 TreeView1DragOver事件中设置接收拖动
if (Source = TreeView1) or (Source = ListView1) then
begin
Accept := True;
end;2,如果是从Treeview到间listview拖动
则ListView1DragDrop事件中用
var
llvi_Module: TListItem; //声明ListViewItem数据类型
If (Source = TreeView1) then
begin
//得到TreeView1的所选
Snode := TreeView1.Selected ;
//在listview中增加
llvi_Module := ListView1.Items.Add;
llvi_Module.Caption := Snode.text;
//删除treeview
//删除子节点
Snode.DeleteChildren ;
//删除当前节点
Snode.Delete ;
end;方过来一样。