I am sorry guys , i have so many problems nowadays so I cannot concentrate on blogging, by the way I came through some forums posts and I really wanted to write something so today you will be learning the Types of Message Boxes in C# and the same types of Message Boxes are available in VB.NET .
What is a Message Box?
Shortly I can say Message Boxes are used to show Messages/Alerts to the user.
What are the types of Message Boxes?
The types of Message Boxes are something very important, if you want to display a message box you should know what is the type of the Message Box is going to be(ie:if you display "Cannot Convert" then that's a Error Message.
Error : Error is something that stops the system from doing it or else we can say something that does not allow doing it.
Exception : Problems that occur during the run of a program or during the usage of a function or a statement.
Why to use Message Boxes?
There are many reasons of using Message Boxes in programs , mostly Message Boxes are used to warn,alert,show errors,ask questions.
How to use Message Boxes in C#?
well, now we are at the main point . everyone knows how to use message box whatever i will tell you how to use Message Boxes.
To show a normal message box.
Code:
To show a title in message box.
Code:
You can choose the set of buttons
To show a message box with title,buttons & icon(type of message)
Code:
I wrote this in my own way i am sorry if there is anything wrong, i hope this has helped you in some ways , i will be writing more articles when i get rid of this depression etc etc , thank you.
What is a Message Box?
Shortly I can say Message Boxes are used to show Messages/Alerts to the user.
What are the types of Message Boxes?
The types of Message Boxes are something very important, if you want to display a message box you should know what is the type of the Message Box is going to be(ie:if you display "Cannot Convert" then that's a Error Message.
- Error Message Boxes.
- Information/Detail Message Boxes.
- Warning Message Boxes.
- Empty Message Boxes.
- Questioning Message Boxes.
- Exception Message Boxes.
Error : Error is something that stops the system from doing it or else we can say something that does not allow doing it.
Exception : Problems that occur during the run of a program or during the usage of a function or a statement.
Why to use Message Boxes?
There are many reasons of using Message Boxes in programs , mostly Message Boxes are used to warn,alert,show errors,ask questions.
How to use Message Boxes in C#?
well, now we are at the main point . everyone knows how to use message box whatever i will tell you how to use Message Boxes.
To show a normal message box.
Code:
MessageBox.Show("This is a normal messagebox");Screenshot:
To show a title in message box.
Code:
MessageBox.Show("This is a Message box with title", "Ultimate programming tutorials");Screenshot:
To show a message box with title and buttons.
Code:
MessageBox.Show("Message Box with title and buttons", "Ultimate programming tutorials", MessageBoxButtons.YesNoCancel);Screenshot:
You can choose the set of buttons
To show a message box with title,buttons & icon(type of message)
Code:
MessageBox.Show("Message Box with title,buttons and icon(type of messagebox)", "Ultimate programming tutorials", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information);Screenshot:
You can choose the type of icon
Post a Comment
Note: Only a member of this blog may post a comment.