Drag and Drop text on Listbox


Does anyone know how to drag a text file into a listbox and she read the text and take the next line (addrow)?

I’ve done the filetype for txt and csv and put me.AcceptFileDrop (FileTypes1.All) in the open event

I appreciate any help!

Do this on your

if obj.TextAvailable then
end if


that’s all

Hello, Horst Jehle

I put your code but nothing happens when I drag the text up the listbox, where I might be going wrong, any ideas?

Are you sure that the event are assigned to the Listbox control? When I make this test project I had the same problem. The Events are assigned to the Window1 and not to Listbox1. This is a problem with the selection of an Element. If is selected and has a grey background, the addevent is relatet to the Window1. If your selected Element has a blue background, than the addevent goes to your element or control.

Obj.text will be empty. Check obj.FolderItem and then get its content via a TextInpuStream.