Is there a way I can change the font types in a MessageBox.Show() to get bigger size, bold, italic styles?
You can always make your own MessageBox creating a new Windows.Forms class:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MessageBoxFont
{
public partial class Message : Form
{
public Message(String text)
{
InitializeComponent();
tbxMessage.Text = text;
btnOK.Focus();
}
private void btnOK_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
Then you can control the properties (like the font, size, color and the like) shown under the solution explorer. You initialize this form like this:
private void OpenMessageBox()
{
String text = "This is a sample error message";
Message message = new Message(text);
message.Show();
}
Its a work-around, however, easier to implement :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With