是否可以在 WinForms 消息框中左对齐(而不是居中对齐)连续行?
希望这个问题说明了一切。我们有一些较长的消息,由 CrLf
字符分隔,并且各行居中对齐。
线条可以左对齐吗?
如果需要的话,我可以创建一个表单并以模态方式显示它,但如果不需要的话那就太好了。
编辑...
抱歉,各位。我的错...我该死的愚蠢问题。
事实证明,我的应用程序中随处显示的消息框是自定义的,并且它继承自表单,而不是继承自 MessageBox。
更糟糕的是,它上面有一个标签来显示消息的文本......而且,您猜对了,它的 TextAlign 属性设置为 MiddleCenter。
我现在要去把我的头撞在钉子上,作为对你们好人添麻烦的忏悔……
Hopefully the question says it all. We have some longish messages, separated by CrLf
characters, and the lines come out centre-justified.
Can the lines be left-justified?
I can create a form and show it modally if I have to, but it would be nice not to have to.
Edit...
Apologies, people. My bad... my damn fool question.
Turns out that the message box shown everywhere in my application is a custom one, and it inherits from a form, not from MessageBox.
Worse still, it was built with a label on it to display the text of the message... and, you guessed it, its TextAlign property was set to MiddleCenter.
I shall now go and bang my head on a spike as penance for troubling you good people...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
消息框对我来说是左对齐的:
The message box is left-aligned for me: