MessageBox doesn't exist in .NET 1.1?

  • Thread starter Thread starter Curious
  • Start date Start date
C

Curious

I have to use .NET 1.1 and Visual Studio 2003.

I need to display messagebox. So I have:

MessageBox.Show(
string.Format("Cash is {0} for
{1}, list: {2}. It is lower than the allowed lower bound {3}!",
cashR.CashForToday,
cashR.Sector, s.List, cashR.LowerBound), "Total Cash Watch");

However, this gives me a compiling error about missing an assembly
namespace.

So I try to add the following:

using System.Windows.Forms;

However, in the intellisense, there is no "Windows" under "System". It
doesn't seem that there is such namespace, "System.Windows.Forms",
in .NET 1.1.

Any advice on how to get MessageBox to compile? Thanks!
 
Hello Curious,
Any advice on how to get MessageBox to compile? Thanks!

You need to add a *reference* to System.Windows.Forms.dll

You're likely writing a console application which does not have this reference
by default.
 
Rory,

Many thanks for the advice! I'll add that reference as you suggested.
Have a great day!
 
One more question:

Where is "System.Windows.Forms.dll" located? I've done a search and
found multiple files with the same file name and don't know which one
to use.
 
FYI, I've found it in "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\"

It may have been easier to find it through the "Add Reference" context
menu in the Solution Explorer.
 
Thanks! I do see it in the "Add Reference" menu on the ".NET" tab.
However, it seems that it only contains assemblies already added to
the project.
 
Back
Top