#2
rainbow12010-12-27 23:34
|
void __fastcall TForm1::ListBox2DragOver(TObject *Sender, TObject *Source,
int X, int Y, TDragState State, bool &Accept)
{
if (Source == ListBox1)
Accept = TRUE; // If The Drag source is listbox1 then accept it
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ListBox2DragDrop(TObject *Sender, TObject *Source,
int X, int Y)
{
if (Source == ListBox1) // If the source is ListBox1 then deal the drag event
{
ListBox2->Items->Add(ListBox1->Items->Strings[ListBox1->ItemIndex]);
}
}
上面是Listbox控件间的拖曳范例(拖曳源内容拖曳后仍存在) 现在是想从一个Treeview控件选中节点内容拖到Listbox控件 该如何修改啊? 我是初学者 大家提提意见 谢谢啊!