RichEdit、winapi - 段落对齐
我希望以这种方式对齐一行,一些第一个单词左对齐,一些最后一个单词右对齐,但所有单词都在同一行:
| 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,唯一的方法是使用制表位。您只需在最右边缘创建一个右对齐的制表位即可。然后您必须将文本编写为
其中 \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
where \t is a Tab character (i.e. U+0009).
我遇到了同样的问题,您需要使用
wParam = TO_ADVANCEDTYPOGRAPHY
和lParam = TO_ADVANCEDTYPOGRAPHY
将消息EM_SETTYPEPOGRAPHYOPTIONS
发送到控件,然后右对齐将PARAFORMAT
与rgxTabs[ n ] += 0x2000000
结合使用即可。I had this same problem, you need to send the message
EM_SETTYPEPOGRAPHYOPTIONS
to the control withwParam = TO_ADVANCEDTYPOGRAPHY
, andlParam = TO_ADVANCEDTYPOGRAPHY
, then right justifying usingPARAFORMAT
with thergxTabs[ n ] += 0x2000000
works.