Is it possible to have styled text in a WebLabel or WebTextarea?

  1. 3 weeks ago

    I would like to have a different style for each paragraph. I believe StyledText is not supported in a web app. Is there any way to do it otherwise?

  2. David C

    Nov 21 Pre-Release Testers, Xojo Pro Derby, ITM

    WebStyles affect the whole control, not the contents. You can insert the Text value as HTML using the <raw></raw> command.

  3. Edited 3 weeks ago

    Thanks David. A quick search found an example which i copied direclty to test on one of my WebTextAreas...

    ta_BrokenBracktes.text = OrthoProHome.cnt_Patient1.InfosArray(1)+EndOfLine+"<raw><strong><em>"+OrthoProHome.cnt_Patient1.InfosArraySettings(1)+"</em></strong></raw>"

    This does not work. Do you see anything wrong here. I get...

    Broken brackets
    <raw><strong><em>0</em></strong></raw>

    Another thread talks about line breaks being a problem so I tried replacing EndOfLine with <BR> in the raw tag, but I then got...

    Broken brackets<BR><raw><strong><em>0</em></strong></raw>

  4. 2 weeks ago

    Greg O

    Nov 23 Xojo Inc

    Raw doesn’t work out n TextAreas. The underlying control presented by the browser doesn’t support it.

    Perhaps it would be better if you told us more about what your needs are. For instance, do you need this text to be editable? If not, you might want to look at the docs for the WebSDK. The example project shows how to make an HTMLArea control where you can send raw html to the browser.

or Sign Up to reply!