RichEdit、winapi - 段落对齐

发布于 2024-08-31 17:00:17 字数 191 浏览 3 评论 0原文

我希望以这种方式对齐一行,一些第一个单词左对齐,一些最后一个单词右对齐,但所有单词都在同一行:

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

这可能吗?我怎样才能做到这一点?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

南风起 2024-09-07 17:00:17

据我所知,唯一的方法是使用制表位。您只需在最右边缘创建一个右对齐的制表位即可。然后您必须将文本编写为

text 1\ttext2
Lorem ipsum\tdolor sit amet

其中 \t 是制表符(即 U+0009)。

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).

2024-09-07 17:00:17

我遇到了同样的问题,您需要使用 wParam = TO_ADVANCEDTYPOGRAPHYlParam = TO_ADVANCEDTYPOGRAPHY 将消息 EM_SETTYPEPOGRAPHYOPTIONS 发送到控件,然后右对齐将 PARAFORMATrgxTabs[ n ] += 0x2000000 结合使用即可。

I had this same problem, you need to send the message EM_SETTYPEPOGRAPHYOPTIONS to the control with wParam = TO_ADVANCEDTYPOGRAPHY, and lParam = TO_ADVANCEDTYPOGRAPHY, then right justifying using PARAFORMAT with the rgxTabs[ n ] += 0x2000000 works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文