listbox中如何将某节点在任意位置进行拖放,和delphi字段编辑器中一样。

lyq 2001-11-29 09:55:18
...全文
80 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
taxi 2001-12-01
  • 打赏
  • 举报
回复
跑了。
王集鹄 2001-12-01
  • 打赏
  • 举报
回复
发帖子的人呢?
taxi 2001-11-30
  • 打赏
  • 举报
回复
^
王集鹄 2001-11-30
  • 打赏
  • 举报
回复
行不行请回话?
王集鹄 2001-11-29
  • 打赏
  • 举报
回复
procedure TForm1.FormDragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
begin
Accept := Source is TListBox;
end;

procedure TForm1.FormDragDrop(Sender, Source: TObject; X, Y: Integer);
begin
with TLabel.Create(Self) do begin
Parent := Self;
Caption := TListBox(Source).Items[TListBox(Source).ItemIndex];
Left := X;
Top := Y;
end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
ListBox1.DragMode := dmAutomatic;
end;

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧