Bupkas,
The using statement is required because the MessageBox class
is located in the System.Windows.Forms namespace. Without the
using statement you could have to use the fullname or not use the
class at all =)
HTH,
//Andreas
--
ANDREAS HÅKANSSON
STUDENT OF SOFTWARE ENGINEERING
andreas (at) selfinflicted.org
"Bupkas" <bu****@cox.net> wrote in message news:#Z**************@TK2MSFTNGP11.phx.gbl...
Thanks. Orignally when I caused the error I had the line,
System.Windows.Forms.MessageBox.Show("string1","st ring2",MessageBoxButtons.O
KCancel);
which still doesn't work. However, when I introduced "using" in the
following line,
using System.Windows.Forms;
and then abridged the one line to,
MessageBox.Show("Hello, world!", "MessageBoxHelloWorld",
MessageBoxButtons.OKCancel);
I introduced the error to "MessageBoxButtons.Abort" while playing with
"MessageBoxIcon.
Now it works. I guess the "using" line is necessary for some reason.
Appreciation expressed. :)
"Mickey Williams" <my first name at servergeek.com> wrote in message
news:uD*************@tk2msftngp13.phx.gbl...
There's no such value as MessageBoxButtons.Abort. If you want the abort
button, you need to specify MessageBoxButtons.AbortRetryIgnore.
--
Mickey Williams
Author, "Microsoft Visual C# .NET Core Reference", MS Press
www.servergeek.com
"Bupkas" <bu****@cox.net> wrote in message
news:eN*************@tk2msftngp13.phx.gbl... using System.Windows.Forms;
class MessageBoxHelloWorld
{
public static void Main()
{
MessageBox.Show("Hello, world!", "MessageBoxHelloWorld"); // Runs ok
MessageBox.Show("Hello, world!", "MessageBoxHelloWorld",
MessageBoxButtons.Abort); // Doesn't compile
}
}