# Here is a simple "TextEditor" control

**URL:** <https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022>\
**Category:** General\
**Created:** [August 27, 2019, 2:24pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022 "2019-08-27T14:24:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [August 27, 2019, 2:24pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/1 "2019-08-27T14:24:48Z")

</div>

I, of course could write one, but if someone already has a drop-in custom control I could use that would be great.

- Formatted Text Control (FTC) is too much of an over-kill for what I need

- Something simple. A textarea, with an attached toolbar (font, size, bold/italic/underline, colors). I’ll deal with load/save as it will be to database fields, not directly to a file.

- macOS/Windows

thanks

---

<div class="post-metadata">

**Author:** ![Martin\_T](https://forum.xojo.com/letter_avatar_proxy/v4/letter/m/a88e57/32.png) [@Martin\_T](https://forum.xojo.com/u/Martin_T)\
**Post date:** [August 27, 2019, 2:33pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/2 "2019-08-27T14:33:57Z")

</div>

Why not using StyledText with TextArea?

> [@451968:@Dave S](#):
>
> \* Formatted Text Control (FTC) is too much of an over-kill for what I need

I don’t agree with that. FTC only needs a few pieces of code to implement the desired functions.

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [August 27, 2019, 2:37pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/3 "2019-08-27T14:37:38Z")

</div>

> [@451972:@Martin Trippensee](#):
>
> Why not using StyledText with TextArea?

of course, but what I am looking for is a simple control WITH toolbar… to just “drop in”

> [@451972:@Martin Trippensee](#):
>
> I don’t agree with that. FTC only needs a few pieces of code to implement the desired functions.

$150 is the “over-kill”, especially since I do not need 90% of what FTC supports.

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [August 27, 2019, 2:44pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/4 "2019-08-27T14:44:51Z")

</div>

HTML Edit, which is in Graffiti Suite now, is a great lightweight text editor that has a built in rich text toolbar. It saves and loads HTML, which is quick and easy to store in a database. And it’s Mac / Windows cross-platform.

Hits all the points, but it’s not $free.

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [August 27, 2019, 2:47pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/5 "2019-08-27T14:47:16Z")

</div>

never mind… I’ll write my own… Thanks

---

<div class="post-metadata">

**Author:** ![Joost\_Rongen](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/a9a28c/32.png) [@Joost\_Rongen](https://forum.xojo.com/u/Joost_Rongen)\
**Post date:** [August 27, 2019, 3:02pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/6 "2019-08-27T15:02:06Z")

</div>

> [@451979:@Dave S](#):
>
> never mind… I’ll write my own… Thanks

I have one which works perfectly fine for Windows and uses MBS.

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [August 27, 2019, 3:07pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/7 "2019-08-27T15:07:07Z")

</div>

Thanks Joost, but need both macOS/Windows and MBS isn’t part of my toolkit

---

<div class="post-metadata">

**Author:** ![Jean-Yves\_Pochez](https://forum.xojo.com/user_avatar/forum.xojo.com/jean-yves_pochez/32/21769_2.png) [@Jean-Yves\_Pochez](https://forum.xojo.com/u/Jean-Yves_Pochez)\
**Post date:** [August 27, 2019, 6:32pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/8 "2019-08-27T18:32:57Z")

</div>

Dave,  
these may help you, declares for textareas from Axel .

[https://www.dropbox.com/sh/zhyg8v5w581zxm6/AADkEdFe0Iq5dyITMtVDp1OQa/TextArea.zip?dl=0](https://www.dropbox.com/sh/zhyg8v5w581zxm6/AADkEdFe0Iq5dyITMtVDp1OQa/TextArea.zip?dl=0)  
[https://www.dropbox.com/sh/zhyg8v5w581zxm6/AABvDJhX7sNFGmdPObrUKNqSa/TextAreaClass2.zip?dl=0](https://www.dropbox.com/sh/zhyg8v5w581zxm6/AABvDJhX7sNFGmdPObrUKNqSa/TextAreaClass2.zip?dl=0)  
[https://www.dropbox.com/sh/zhyg8v5w581zxm6/AADcB0TS7EVt6y\_toi8N-QGYa/TextAreaClass3.zip?dl=0](https://www.dropbox.com/sh/zhyg8v5w581zxm6/AADcB0TS7EVt6y_toi8N-QGYa/TextAreaClass3.zip?dl=0)  
[https://www.dropbox.com/sh/zhyg8v5w581zxm6/AACGiL7APfPS0UXudIELY\_6Ca/TextAreaClass4.zip?dl=0](https://www.dropbox.com/sh/zhyg8v5w581zxm6/AACGiL7APfPS0UXudIELY_6Ca/TextAreaClass4.zip?dl=0)  
[https://www.dropbox.com/sh/zhyg8v5w581zxm6/AAA70T8nMLna\_KvPfSwz\_c67a/TextAreaLink.zip?dl=0](https://www.dropbox.com/sh/zhyg8v5w581zxm6/AAA70T8nMLna_KvPfSwz_c67a/TextAreaLink.zip?dl=0)  
[https://www.dropbox.com/sh/zhyg8v5w581zxm6/AACC6h090qJdrW4vqb6xA3kSa/TextAreaLinuxXojo.zip?dl=0](https://www.dropbox.com/sh/zhyg8v5w581zxm6/AACC6h090qJdrW4vqb6xA3kSa/TextAreaLinuxXojo.zip?dl=0)

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [August 27, 2019, 6:39pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/9 "2019-08-27T18:39:46Z")

</div>

Thanks… too bad the zip file is missing about 100 images…

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [August 27, 2019, 6:45pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/10 "2019-08-27T18:45:57Z")

</div>

For MacOS, there is a declare which turns TextArea into a simpletext control. Of course, that was quite a while ago, and I could not find it in this forum.

I hope someone who is familiar with it will post a link.

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [August 27, 2019, 6:51pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/11 "2019-08-27T18:51:45Z")

</div>

Michel , I actually did find exactly what you mentioned, and that would have been great except for the fact it was macOS only.

My needs are simple, and I’m almost done with a custom control that will do what I need, and works xPlat as well

---

<div class="post-metadata">

**Author:** ![Jean-Yves\_Pochez](https://forum.xojo.com/user_avatar/forum.xojo.com/jean-yves_pochez/32/21769_2.png) [@Jean-Yves\_Pochez](https://forum.xojo.com/u/Jean-Yves_Pochez)\
**Post date:** [August 27, 2019, 7:02pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/12 "2019-08-27T19:02:42Z")

</div>

> [@452023:@Dave S](#):
>
> Thanks… too bad the zip file is missing about 100 images…

they are in this file : [Dropbox - TextArea.zip - Simplify your life](https://www.dropbox.com/sh/zhyg8v5w581zxm6/AADkEdFe0Iq5dyITMtVDp1OQa/TextArea.zip?dl=0)  
the “def\_icons” folder.

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [August 27, 2019, 7:04pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/13 "2019-08-27T19:04:38Z")

</div>

my point was they were all disconnected, and after clicking thru dozens of them I had to reboot my system to get control back again…

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [August 27, 2019, 8:24pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/14 "2019-08-27T20:24:48Z")

</div>

Here is what I created… it fits my current needs… and may or may not be of interest to anyone else  
It seems to work with both macOS (mojave) and Windows 10

[www.rdS.com/simpleText.xojo\_xml\_project.zip](http://www.rdS.com/simpleText.xojo_xml_project.zip)

![](http://www.rdS.com/simpletext.png)

---

<div class="post-metadata">

**Author:** ![Jean-Yves\_Pochez](https://forum.xojo.com/user_avatar/forum.xojo.com/jean-yves_pochez/32/21769_2.png) [@Jean-Yves\_Pochez](https://forum.xojo.com/u/Jean-Yves_Pochez)\
**Post date:** [August 27, 2019, 8:58pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/15 "2019-08-27T20:58:25Z")

</div>

need to change the set method of the rtfData property to :

```auto
If value<>"" Then
  theTextArea.StyledText.RTFData=value
End If
reset
```

or I get a Nil exception on launch.  
otherwise nice !

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [August 27, 2019, 9:00pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/16 "2019-08-27T21:00:33Z")

</div>

> [@452039:@Jean-Yves Pochez](#):
>
> need to change the set method of the rtfData property to :

Thanks

I think it should be

```auto
If value<>"" Then 
  theTextArea.StyledText.RTFData=value
Else
  theTextArea.Text=value
End If
reset
```

otherwise any existing text is not removed

---

<div class="post-metadata">

**Author:** ![Jean-Yves\_Pochez](https://forum.xojo.com/user_avatar/forum.xojo.com/jean-yves_pochez/32/21769_2.png) [@Jean-Yves\_Pochez](https://forum.xojo.com/u/Jean-Yves_Pochez)\
**Post date:** [August 27, 2019, 9:04pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/17 "2019-08-27T21:04:14Z")

</div>

for the records, just recall this RB little module to edit texts and convert to html  
[http://cosmicsoft.net/RB/StyledTextToHTML](http://cosmicsoft.net/RB/StyledTextToHTML)  
still opens with 2019r11

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [August 27, 2019, 9:10pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/18 "2019-08-27T21:10:31Z")

</div>

I got it to open with 2012, but it did “nothing”… and 2019 doesn’t even recoginize it

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [August 27, 2019, 9:25pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/19 "2019-08-27T21:25:50Z")

</div>

I opened it with Xojo 2015r1 and it works (generate the html code for the passed styled text, not an html file).

---

<div class="post-metadata">

**Author:** ![Jean-Yves\_Pochez](https://forum.xojo.com/user_avatar/forum.xojo.com/jean-yves_pochez/32/21769_2.png) [@Jean-Yves\_Pochez](https://forum.xojo.com/u/Jean-Yves_Pochez)\
**Post date:** [August 27, 2019, 9:59pm UTC](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022/20 "2019-08-27T21:59:12Z")

</div>

> [@452042:@Dave S](#):
>
> and 2019 doesn’t even recoginize it

you must drag the file to the xojo 2019 app icon to open it. not do file-open inside xojo.

[Next page](https://forum.xojo.com/t/here-is-a-simple-texteditor-control/50022.md?page=2)
