Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > How to use MsgBox in c# for a class library
 

How to use MsgBox in c# for a class library

Is this possible ?

In this exemple: http://msdn2.microsoft.com/en-us/library/9cdb5eda(VS.80).aspx

they are using MsgBox which is in Microsoft.VisualBasic namespace. However, I can't use it in c#. Because I don't have a windows program, I can't use the MessageBox as well because I don't have access to System.Windows namespaces.

Is it possible to have a messagebox in C# ? If so, how !

thanks.

abuck  Wednesday, March 01, 2006 6:56 PM
Hi,
the message box is located at: System.Windows.Forms, to use it just do:
System.Windows.Forms.MessageBox.Show("Test");

don't forget to include the System.Windows.Forms reference in your project.
n0n4m3  Wednesday, March 01, 2006 7:38 PM
Hi,
the message box is located at: System.Windows.Forms, to use it just do:
System.Windows.Forms.MessageBox.Show("Test");

don't forget to include the System.Windows.Forms reference in your project.
n0n4m3  Wednesday, March 01, 2006 7:38 PM

System.Windows.Forms.MessageBox.Show("body", "title", System.Windows.Forms.MessageBoxButtons.YesNo);

for get answer from click event

if (System.Windows.Forms.MessageBox.Show("body", "title", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)

{

//code yes

}

else

{

//code No

}

Cristian Altamirano LLanos  Thursday, April 24, 2008 7:22 PM
thank u so much
Dhanapriya  Wednesday, July 02, 2008 10:02 AM
Thanks, very usefull
Roger Heugen  Monday, August 31, 2009 8:28 AM

You can use google to search for other answers

Custom Search

More Threads

• Application Name Problem during Setup and Deployment
• Project deployment use case feasibility
• publishing and default problem
• deployment problem (non ClickOnce)
• ClickOnce file extension registration
• more than one application update location (ClickOnce)
• SQL Server / Publish Project Essue
• Configuring an MSI deployed click-once application to consume WCF services.
• Program Icon Question
• Help with clickonce deployment.