How can I add message to popup text box:
catch (Exception)
{
Interaction.MsgBox(Conversion.ErrorToString(), MsgBoxStyle.Critical, null);
}
How can I add message to popup text box:
catch (Exception)
{
Interaction.MsgBox(Conversion.ErrorToString(), MsgBoxStyle.Critical, null);
}
You can use the MessageBox class.
catch (Exception)
{
MessageBox.Show(
Conversion.ErrorToString(), // Caption
"Error:", // Title displayed
MessageBoxButtons.OK, // Only show OK button
MessageBoxIcon.Error); // Show error icon (similar to Critical)
}
MessageBox.Show("text", "caption", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);
Also, I see you tagged the post C#. If you're using C#, don't use anything in the Microsoft.VisualBasic namespace (which is where Interaction lives)
The Microsoft.VisualBasic namespace contains types that support the Visual Basic Runtime in Visual Basic.