Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1185
  • Last Modified:

Drag and drop text into TMemo

I have tried lots of code that implements drag and drop but none work right. I'm trying to drag and drop plain text (from notepad, IE, and wordpad ) to my app's TMemo.
0
dc_mo
Asked:
dc_mo
  • 3
  • 2
1 Solution
 
Ephraim WangoyaCommented:
The easiest way to Drag and Drop text from your application to MS Word or Wordpad is to use a TRichEdit control instead of a TMemo

Using a TRichEdit, you dont have to write any code, the drag and drop is handled automatically

Otherwise you can take a look at the Drag and Drop component suite from
http://melander.dk/delphi/dragdrop/

0
 
dc_moAuthor Commented:
The easiest way to Drag and Drop text from your application to MS Word or Wordpad is to use a TRichEdit control instead of a TMemo

Can I enable plain text mode of TRichEdit and accept plain text drag and drop from notepad or wordpad? How about IE? This is what I did :

RichEdit1.PlainText := True;
RichEdit1.DragMode := dmAutomatic;
Form1.FormStyle := fsStayOnTop;

Does not work. please provide a working example.
0
 
Ephraim WangoyaCommented:

Yes you can enable Plaintext
Don't set DragMode

This will work for all browsers, IE, Chrome, Firefox and any text editor that allows you to drag text.

However, Notepad does not allow you to drag text

You can test by just creating a new project, drop in a TRichEdit on the Mainform, and run the application
Try draging and droping text into the richedit from Wordpad
0
 
dc_moAuthor Commented:
Works great with WordPad, Safari, but IE displays a no drag cursor icon. Why? Must be related to security?
0
 
Ephraim WangoyaCommented:

Could be, Microsoft can sometimes be choking with all these restrictions but I guess they need the security
I'm able to do it with IE though
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now