Pages

Monday, 1 August 2011

MessageBox Examples in C# WinForms

1. Default MessageBox with OK button.



MessageBox.Show("Welcome to Csharp-Language.blogspot.com");

2. Default MessageBox with OK button and Title.

 

MessageBox.Show("Welcome to Csharp-Language.blogspot.com","C#Language");
3 .MessageBox with Yes , No , Cancel , Abort ,Retry and Ignore Button



A - MessageBox with Yes and No Button



MessageBox.Show("Do you want to Continue ?","Question",MessageBoxButtons.YesNo);





B - MessageBox with Yes , No and Cancel Button

MessageBox.Show("Do you want to Continue ?", "Question", MessageBoxButtons.YesNoCancel);
C - MessageBox with Retry and Cancel Button

 

MessageBox.Show("Do you want to Continue ?", "Question", MessageBoxButtons.RetryCancel);
D - MessageBox with Abort , Retry and Ignore button



MessageBox.Show("Do you want to Continue ?", "Question", MessageBoxButtons.AbortRetryIgnore);
E - MessageBox with OK and Cancel Button



MessageBox.Show("Do you want to Continue ?", "Question", MessageBoxButtons.OKCancel);
4. MessageBoxIcon Asterisk , Error , Exclamation and Question



A - MessageBoxIcon Asterisk



MessageBox.Show("Message Box Icons ..!!", "Icons",MessageBoxButtons.YesNo,MessageBoxIcon.Asterisk);
B - MessageBoxIcon Error



MessageBox.Show("Message Box Icons ..!!", "Icons",MessageBoxButtons.YesNo,MessageBoxIcon.Error);
C - MessageBoxIcon Exclamation



MessageBox.Show("Message Box Icons ..!!", "Icons",MessageBoxButtons.YesNo,MessageBoxIcon.Exclamation);
D- MessageBoxIcon Question



MessageBox.Show("Message Box Icons ..!!", "Icons",MessageBoxButtons.YesNo,MessageBoxIcon.Question);




0 comments:

Post a Comment