如何在c#代码的消息框中使字符串变量的字体颜色变为红色?

Sta*_*ace 1 c# winforms

我有这个代码

public static bool Delete(int ID, string ProductName)
    {
        if (MessageBox.Show(productName + " will be deleted Permanently ", "Confirm Delete Option", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
            {
                return false;
            }
        {
            return true;
        } 
    }
Run Code Online (Sandbox Code Playgroud)

我需要的是使消息框中的productName下面为红色

if (MessageBox.Show(productName + " will be deleted Permanently "
Run Code Online (Sandbox Code Playgroud)

Dan*_*eih 5

您必须为此创建自己的表单.在那里你创建一个标签并定义你的字体.之后,您可以定义您的noyes按钮.

private void No_button_Click(object sender, EventArgs e)
{
    this.DialogResult = DialogResult.No;
    this.Close();
    this.Close();
}
Run Code Online (Sandbox Code Playgroud)

同为yes按钮有通过创建自己的形式,例如限位多等优点.