Search code examples
winapirichedittext-alignmentparagraphs

RichEdit, winapi - paragraph aligment


I would like to have a line aligned in such way, that some first words are aligned left and some last words are aligned right, but all are in the same line:

| text 1                           text2 |
| Lorem ipsum             dolor sit amet |

Is that possibile? How can I do that?


Solution

  • As far as I know, the only way is to use tab stops. You simply create a right-justified tab stop at the very right edge. Then you have to write your text as

    text 1\ttext2
    Lorem ipsum\tdolor sit amet
    

    where \t is a Tab character (i.e. U+0009).