Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Drag and drop text into TMemo

Posted on 2011-02-23
5
Medium Priority
?
1,078 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

719 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