I have troubles with a Styled TextArea and tabs

[quote]You simply read the whole data from a rtf file with a TextInputStream and pass it to RTFData[/quote] What I mean is that there is no direct way to do something like TextArea1.StyledText.RTFControlString = “\tx567\tx1134”. Xojo does explicitly handle bolding, alignment, italicizing, colors, and a few others, but there is not an obvious way to insert a generic control string. So far for me, Xojo interprets what I try to put in literally (as in Xojo thinks the control strings are text to be displayed).

That’s why I used the paste method and it DOES work. Seriously, put the following in the open event handler for a text area:

[code] // This will set tab stops every centimeter for 21 cm

dim st as string = “{\rtf1\ansi\ansicpg1252\cocoartf1265” + EndOfLine + “{\fonttbl\f0\fswiss\fcharset0 Helvetica;}” + EndOfLine + “{\colortbl;\red255\green255\blue255;}” _

  • EndOfLine +"\margl1440\margr1440\vieww25800\viewh16040\viewkind0" + EndOfLine _
  • “\pard\tx567\tx1134\tx1699\tx2266\tx2833\tx3400\tx3967\tx4534\tx5101\tx5668\tx6235\tx6802\tx7369\tx7936\tx8503\tx9070\tx9637\tx10204\tx10771\tx11338\tx11905\pardeftab720\pardirnatural” _
  • EndOfLine + EndOfLine + “\f0\fs24 \cf0 a}”

Dim c As New Clipboard
c.AddRawData(st,“public.rtf”)
c.Close

me.paste
[/code]
You will see that you do indeed now have 21 tab stops on one line. You’ll have to expand your window to see them all. You REALLY need to try this.

Dan