MessageBox doesn't exist in .NET 1.1?

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!
 
R

Rory Becker

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

Curious

Rory,

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

Curious

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

Jeff Gaines

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

Curious

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top