Why can not I display the MessageBoxButtons if it is not a string?

5

Why am I not able to display MessageBoxButtons if it is not a string?

static void Main()
{
    string texto = "Minha primeira MessageBox";
    MessageBoxButtons botao = MessageBoxButtons.OKCancel;
    DialogResult result;
    result = MessageBox.Show(texto, botao);
    if(result == DialogResult.OK)
    {
        MessageBox.Show("Isso ai");
    }
}
    
asked by anonymous 20.11.2015 / 01:15

1 answer

5

Because this syntax does not exist. There is only one method that accepts MessageBoxButtons if there are 2 parameters string before (the second is caption ):

result = MessageBox.Show(texto, "Proceder", botao);

Documentation .

List of existing overloads .

    
20.11.2015 / 01:49