Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 21st, 2012, 06:03 AM
zasarafljivac zasarafljivac is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 1 zasarafljivac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 13 sec
Reputation Power: 0
Firemonkey TListBox drag and drop problem

Hello,

I have a ListBox that I need to contain list of files. I need functionality for user to select one or multiple files and than to drag files and drop them on the ListBox. When files are dropped, Items are created with a file names. This works fine, but the problem is, when I drag over and drop file on a dynamically created Item inside ListBox, file icon remains drawn on a desktop as a "ghost". Please check following screenshots for more details:

http://www.razno.org/uploads/1.jpg
http://www.razno.org/uploads/2.jpg

This "sample.txt" icon remains on desktop. Can anyone tell me what am I doing wrong?

This is the code used for drag and drop operation:

Code:
procedure TTestForm.FileListBoxDragDrop(Sender: TObject; const Data: TDragObject;
  const Point: TPointF);
var
  i: integer;
  item: TListBoxItem;
begin
  try
    FileListBox.BeginUpdate;
    for i := Low(Data.Files) to High(Data.Files) do begin
      Item := TListBoxItem.Create(Self);
      Item.Text := ExtractFileName(Data.Files[i]);
      Item.Parent := FileListBox;
    end;
  finally
    FileListBox.EndUpdate;
  end;
end;
 
procedure TTestForm.FileListBoxDragOver(Sender: TObject; const Data: TDragObject;
  const Point: TPointF; var Accept: Boolean);
begin
  Accept := True;
end;




Thank you,

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > Firemonkey TListBox drag and drop problem

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap