Which is the equivalent NameSpace in white for displaying Messages using Messagebox

Oct 26, 2010 at 11:48 AM

Hi,

Please let me know the namespace that I need to include in my project for displaying messages using Messagebox in white.

I windows forms applications for C#.NET we use Windows.System.Forms.

What is the equivalent one in white.

Thanks,

Kavin

 

 

Oct 26, 2010 at 12:07 PM
Edited Oct 26, 2010 at 12:07 PM

Hi

 

you can also use Message boxes from Forms, but as far as I know, you had to use it this way:

 

using MessageBox = System.Windows.Forms;

 

MessageBox.Show("Hello");

or

 

System.Windows.Forms.MessageBox.Show("Hello")

 

because there are multiple definitions if you include some White namespaces and Windows.Forms

 

I have tried both, and it works, but why do you want to pop up a message box?

 

Throndorin

Oct 27, 2010 at 6:39 AM

Hi,

I have put my code in the Try catch block. Hence if an exception occurs I wanted to display a message using Message Box.

When I tried to put using System.Windows.Forms in the beginning of the file the code does not compile at all. It gives the warning message.

"Application is an ambiguous reference between 'White.Core.Application' and 'System.Windows.Forms.Application.

Hence after reading your suggestion I used System.Windows.Forms.MessageBox.Show("File is not Found") and it worked fine.

Thanks,

Kavin

 

 

Oct 27, 2010 at 8:47 AM

Hi

maybe System.Diagnostic.Trace would be a good alternative to Messagebox, so you don't break your test flow.

 

Throndorin