# Drag row from Listbox to drop in Textfield

**URL:** <https://ifnotnil.com/t/drag-row-from-listbox-to-drop-in-textfield/1441>\
**Category:** Xojo\
**Created:** [23 December 2020 17:22 UTC](https://ifnotnil.com/t/drag-row-from-listbox-to-drop-in-textfield/1441 "2020-12-23T17:22:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [23 December 2020 17:22 UTC](https://ifnotnil.com/t/drag-row-from-listbox-to-drop-in-textfield/1441/1 "2020-12-23T17:22:10Z")

</div>

On TOF there is a thread about how to do this and some of the solutions are more complex than need be  
The Xojo TextArea will accept drag & drops of TEXT IF you simply set the type of text to “public.utf8-plain-text” (there are others that it will accept if the text area is styled

1. new desktop project (I used 2020r2.1)
2. add a text area and a listbox
3. enable “allow row dragging” on the listbox in the inspector
4. implement the listbox open event to put some text tin several rows
5. implement the listbox dragrow event with

```auto
drag.RawData("public.utf8-plain-text") = Me.Cell(row,0) 
Return True
```

you’re done  
now drag the listbox rows into the text area

---

<div class="post-metadata">

**Author:** ![MarkusWinter](https://ifnotnil.com/user_avatar/ifnotnil.com/markuswinter/32/32_2.png) [@MarkusWinter](https://ifnotnil.com/u/MarkusWinter)\
**Post date:** [24 December 2020 06:56 UTC](https://ifnotnil.com/t/drag-row-from-listbox-to-drop-in-textfield/1441/2 "2020-12-24T06:56:36Z")

</div>

> [@npalardy](#):
>
> there are others that it will accept if the text area is styled

Which ones? 😉

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [24 December 2020 15:03 UTC](https://ifnotnil.com/t/drag-row-from-listbox-to-drop-in-textfield/1441/3 "2020-12-24T15:03:00Z")

</div>

public.rtf seems to work for the bits of RTF that TextAreas support  
and public.html may as well
