Pages

Friday, 27 July 2012

Displaying MessageBox

Drag a button control into the form.Change its text property as CLICK ME(text property changed by using properties window.) .Double click the button to view the code editor window.
Put the following code inside the button click event.
                              MessageBox.Show("Welcome to C#");
If you want to customize the message box

              MessageBox.Show("Welcome to C#","Message",MessageBoxButtons.OKCancel ,MessageBoxIcon.Information   );
 

1 comments: