I hope to to drag a text string and its hyperlink from an HTML page to a TEdit. For example
displays aaa
actual string is <a href=somewhere.html>aaa</a>
I try to use drag&drop vc开发者_如何学JAVAl, but found that it only can catch aaa
itself rather than the string and its hyperlink.
Welcome any comment
Thanks interdev
Go download Anders Melander's free Drag and Drop Component Suite. In it you'll find TDropURLTarget
to put on your form. Set its Target
property to refer to your TEdit
control, and when a URL is dropped there, the component's URL
and Title
properties will be updated so you can inspect them during the OnDrop
event handler. The suite comes with several examples; TargetDemo has the basics.
Another good library is Raize DropMaster.
Anyway, I believe that it IS possible to do what you want, but maybe it'll turn out to be HTML or RTF drag/drop? Hard to say. I can, for example, drag/drop the list of hyperlinks on this page (over there to the right, under "RELATED") into Word, and they all show up, with hyperlinks on board. So it IS possible. But I suspect that WinWord is dropping as HTML.
Anyway, Rob's suggestion of looking at examples is a good one - between that library and Raize, you should find something that you can use as a prototype.
精彩评论