Go Back  Xtreme Visual Basic Talk > Other Languages > Miscellaneous Languages > Message Box in C#


Reply
 
Thread Tools Display Modes
  #1  
Old 01-24-2008, 12:12 PM
Xarzu Athanasop Xarzu Athanasop is offline
Newcomer
 
Join Date: Jan 2008
Posts: 7
Default Message Box in C#

What is a good way to code a messagebox in C#, like the AfxMessageBox in used in Visal C++?

For code like the following, there must be a "using..."
declaration missing because I got this error:
error CS0246: The type or namespace name 'MessageBoxButtons' could not be found (are you missing a using directive or an assembly reference?)

Code:
string message = "blah";
string caption = "blah";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
DialogResult result;

result = MessageBox.Show(message, caption, buttons, icon);



Also, is there a good way to write information out to a log file?
Reply With Quote
  #2  
Old 01-24-2008, 01:07 PM
AtmaWeapon's Avatar
AtmaWeapon AtmaWeapon is online now
Ultimate Contributor

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 7,598
Default

Question 1: The using declaration you are missing is System.Windows.Forms.

Question 2: Yes, there's many good ways to write information to a log file in many different programming languages.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:

Powered by liquidweb