How can I drag a .txt file into a textbox on my form and show the contents of the textfile? I tried with a rich text box, but it only put an icon of the textfile in there...
How can I drag a .txt file into a textbox on my form and show the contents of the textfile? I tried with a rich text box, but it only put an icon of the textfile in there...
VB Code:
Private Sub RichEdit_OLEDragDrop(Data As RichTextLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single) RichEdit.LoadFile Data.Files(1) End Sub
This is using a richtextbox, for and ordinary textbox replace ".loadfile"
with a functon to load the file. It is also assuming only one file
is being dropped on the control hence the ".Files(1)".
I'm not sure if you have to change the OLEDropMode to manual or not.
Thanks :) just what I needed