C # formatting MessageBox

I want to display a MessageBox warning the user of the completion of the process and giving a breakdown of how long each step of the process took. I have text that I want to display accordingly, but the default font for the MessageBox class is not monospaced. As far as I can tell, there is no way to specify the font displayed by the text.

Is there any library because of the box that I can use for this, or will I have to write it myself?

+8
c # format winforms messagebox
source share
4 answers

Any reason to not just create a Form with a text box / label using a monospace font and then call Form.ShowDialog ? It looks like a separate library, and that will be too much for me.

+12
source share

For writing this is really possible, MessageBox () expands the tabs. For example:

  private void button1_Click(object sender, EventArgs e) { MessageBox.Show( "hello\tworld\r\n" + "second\tline"); } 

It is unlikely that the width of the word begins to approach the width of the tab. You should still prefer a small helper form with a ListView.

+9
source share

It looks like you can just add a new form and use a few shortcuts.

+2
source share

I just wrote one file replacement for a MessageBox with a variable font. You can download it here and use it as a standard MessageBox:

http://www.codeproject.com/Articles/601900/FlexibleMessageBox-A-flexible-replacement-for-the

Regards, JΓΆrg

+2
source share

All Articles