Solved

Drag and drop text into TMemo

Posted on 2011-02-23
5
1,040 Views
Last Modified: 2012-05-11
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
Comment
Question by:dc_mo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 34962212
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
 

Author Comment

by:dc_mo
ID: 34962806
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
 
LVL 32

Accepted Solution

by:
Ephraim Wangoya earned 500 total points
ID: 34962882

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
 

Author Comment

by:dc_mo
ID: 34963153
Works great with WordPad, Safari, but IE displays a no drag cursor icon. Why? Must be related to security?
0
 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 34963184

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

752 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