Results 1 to 3 of 3

Thread: [Resolved] How to drag a .txt file into a textbox and show the text?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Location
    Norway
    Posts
    88

    [Resolved] How to drag a .txt file into a textbox and show the text?

    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...
    Last edited by ZenMan; Jul 2nd, 2002 at 07:46 AM.
    - zen

  2. #2
    DeadEyes
    Guest
    VB Code:
    1. Private Sub RichEdit_OLEDragDrop(Data As RichTextLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
    2.   RichEdit.LoadFile Data.Files(1)
    3. 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.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Location
    Norway
    Posts
    88
    Thanks just what I needed
    - zen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width