i 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);

then 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

i 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);

There must be some sort of "using ..."
declaration missing.

I got a compile error:
error CS0246: The type or namespace name 'MessageBoxButtons' could not be found (are you missing a using directive or an assembly reference?)

>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.

using System.Windows.Forms;
fixed the problem.

I got this compile message:
error CS0103: The name 'MessageBox' does not exist in the current context

But not now.
Muchas Gracias

im having a problem with the MessageBox's yes and no option

either button i clicked, it does not close right away, but will only do so on the second click. so if i had put any code within the yes or no click, it gets executed twice because of this

by the way, my messagebox appears when i click a cell inside the datagridview object because i placed a delete icon there in 1 column

I'd debug the DialogResult to see what or how many you're getting back. It could also be that the messagebox is being displayed twice when the cell click event is fired. If that is the case, either debug the click event or add a bool to only allow the messagebox to be displayed once.

i got it. the event handler was added twice. still ... it should have overwritten it if i added it twice... not have 2 event handlers

This article has been dead for over six months. Start a new discussion instead.