C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Definitions » General »

MessageBox


Posted Date: 04 Nov 2009    Resource Type: Definitions    Category: General
Author: Abhisek PandaMember Level: Gold    
Rating: 1 out of 5Points: 5



Message Box



MessageBox is used to display a message to the user. MessageBox displays a message and provide buttons that user can use to give a response. The syntax is as follows,

MessageBox(prompt,[buttons],[title])

Prompt:- It is a string that should appear in the message box or it is the actual message we want to give to the user.

Buttons:- The type of buttons and icons to appear in the message box should be specified here. It is an optional argument as MessageBox shows OK button by difult. The optional arguments for buttons and icons are as follows,

Constants value Description
------------------------------------------------------------------------------------
OKOnly 0 Displays only OK button.
OKCancel 1 Displays OK and Cancel buttons.
AbortRetryIgnore 2 Displays Abort,Retry and Ignore buttons.
YesNoCancel 3 Displays Yes, No and Cancel buttons.
YesNo 4 Displays Yes and No buttons.
Exclamation 48 Displays an exclamation icon.

There are several other constants for icons like Information, Error, Abort,etc.

Title:- The string passed will be displayed as the title of the message box.

Example:-

MessageBox.Show("Want to Continue?",MessageBoxStyle.YesNoCancel+MessageBoxStyle.Exclamation,"Information")


The above example will display a message box with Yes, No and Cancel buttons with an exclamation icon containing the message 'Want to Continue?'.

We can also use the integer values for specifying the button and icon as follows,

MessageBox.Show("Want to Continue?",51,"Information")
Here 51 specifies the addition of button value and icon value(3+48)



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Windows  .  MessageBox  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Smart Client Software Factory – Default Project Creation
Previous Resource: ClickOnce Deployment Architecture
Return to Discussion Resource Index
Post New Resource
Category: General


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use