Recommended Answers
Jump to Posti can help with the message box question,
the snippet below is used to create a dialog box :string message = "blah";
string caption = "blah";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
DialogResult result;result = MessageBox.Show(message, caption, buttons, icon);
Jump to Postthen you just write event handlers for the yes/no buttons.
e.g. for yes:if (result == System.Windows.Forms.DialogResult.Yes)
{
this.Close();
}you may have guessed this dialog box can be used for a "are you sure you want to quit" scenario. hope this helps
Jump to Post>The type or namespace name 'MessageBoxButtons' could not be found
Are you getting the same error for MessageBox? They're in the same namespace: System.Windows.Forms.
Jump to Postok which namespaces do you have in your code?
make sure you have
using System.Windows.Forms;
All 13 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.