[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Drag & Drop using DirectoryListBox / FileListBox

Posted on 1999-12-13
1
Medium Priority
?
1,718 Views
Last Modified: 2012-06-21
I have a DirectoryListBox and a FileListBox on a form. I am trying to accomplish two tasks:

First:

I want to be able to select a file from the FileListBox and drag the file into a folder in the DirectoryListBox. Obviously it would be a different folder than where the file currently resides.

Second:

I would like to be able to edit the name of the file in the FileListBox control.

Basically, I am needing Windows Explorer type functionality using these two objects. I am using Delphi 3.0 Professional.

Thanks in Advance for any "code" snippets or sample apps.

paulacf
0
Comment
Question by:paulacf
1 Comment
 
LVL 17

Accepted Solution

by:
inthe earned 200 total points
ID: 2278436
Plop a DirectoryListBox on a form along with a FileListBox. Change the FileListBox property of "DragMode" to Automatic instead of manual.
 
procedure TForm1.DirectoryListBox1DragOver(Sender, Source: TObject; X,   Y: Integer; State: TDragState; var Accept: Boolean);
begin
  Accept := Source is TFileListBox;
  ShowMessage(FileListBox1.Items[FileListBox1.ItemIndex]);
end;

for some great dragdrop components see here:
http://www.melander.dk/delphi/dragdrop/

to rename a file you can use:

RenameFile(FileListBox1.FileName,'THENEWFILE.FILE');

i think the example in the delphi demos directory might do this (delphi\demos\doc\filmanex) directory.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Get the source code for a fully functional Access application shell with several popular security features that Access VBA application developers desire, but find difficult or impossible to figure out how to code. You get the source code for managi…
Suggested Courses

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question