我在delphi应用程序窗体上放了四个button,当我的程序运行时,
四个button当然是不可移动的,
我要实现在运行时就像delphi在设计时那样,可以全部选中四个button,
并且随便拖动?
哪有这样的资料?

解决方案 »

  1.   


    给你一个例子比如窗体上有两个Listbox,下面将Listbox2中的项目拖到ListBox1中将两个Listbox的DragMode属性设为dmAutomatic.拖放经过事件procedure TForm1.ListBox1DragOver(Sender, Source: TObject; X, Y: Integer;State: TDragState; var Accept: Boolean);beginif TListBox(Source)=ListBox2 thenAccept:=true;end;//拖放落下事件procedure TForm1.ListBox1DragDrop(Sender, Source: TObject; X, Y: Integer);beginListBox1.Items.Add(Listbox2.Items[ListBox2.ItemIndex]);end;
     
       
    你也可以看看论坛上以前的问题!搜索一下