C# formatting a MessageBox(C# 格式化 MessageBox)
问题描述
我想显示一个消息框,提醒用户该过程已完成,并详细说明该过程的每个阶段所用的时间.我已经将要显示的文本进行了适当的格式化,但是 MessageBox 类的默认字体不是单宽的.据我所知,没有办法指定文本显示的字体.
I want to display a MessageBox alerting the user that the process is complete, and giving a breakdown on how long each stage of the process took. I've got the text that I want to display formatted appropriately, but the default font of the MessageBox class is not mono-width. As far as I can tell, there's no way to specify the font that the text displays with.
是否有一个开箱即用的库可供我使用,还是我必须自己编写一个?
Is there an out-of-the-box library somewhere that I can use for this, or am I going to have to write one up myself?
推荐答案
有什么理由不只是使用等宽字体创建带有文本框/标签的 Form,然后调用 Form.ShowDialog代码>?听起来像一个单独的库对我来说太过分了.
Any reason not to just create a Form with a textbox/label using a monospace font, then call Form.ShowDialog? Sounds like a separate library with that would be overkill to me.
这篇关于C# 格式化 MessageBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:C# 格式化 MessageBox
基础教程推荐
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
