Click here to Skip to main content
15,908,455 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
Hello,

I want to show message box with the icon small, i.e. information box.
Please help me.

UPDATE from OP:
MessageBoxIcon.Information(MessageBox.Show("Record save Successfully"));
It is not working, please suggest.
Posted
Updated 7-May-11 21:17pm
v3

Is it something like this?
MessageBox[^]

Solution as others have suggested:
C#
MessageBox.Show("Record save Successfully!!", "Record saved", MessageBoxButtons.OK, MessageBoxIcon.Information);


You can combine MessageBox.Show in many ways.
Perhaps one way should be to show a message box and ask you if he whats to continue to edit current record?

C#
DialogResult result = MessageBox.Show("Record save Successfully!!" + Environment.NewLine + "Continue edit current record?",
                        "Record saved",
                        MessageBoxButtons.YesNo,
                        MessageBoxIcon.Question,
                        MessageBoxDefaultButton.Button2);

// Default button for MessageBox is Button2 = No.
// If user press enter when the MessageBox is showing. User will select "No".
if (result == DialogResult.No)
{
  Close(); // Close form
}
 
Share this answer
 
v2
Comments
Ed Nutting 8-May-11 5:42am    
Good link though perhaps pointing out which bit he needs would have improved it, my 4 :)
Sergey Alexandrovich Kryukov 8-May-11 11:54am    
Disagree! Helping is good, but what you recommend is the way to turn this place into kindergarten (or is it already? :-)


So, my 5 for this answer. It's even more useful.
--SA
Ed Nutting 9-May-11 2:23am    
It was a 'primary school question' so give it a primary school answer. When was the last time you gave a primary school kid an entire page of a textbook to search through when he barely knew what he was looking for in the first place? I think combining the answer would be best in this case, it's not exactly hard after all ;P

Ed :)
Sergey Alexandrovich Kryukov 9-May-11 3:14am    
I'm not against the sample, I was against your 4 based on the lack of one.
If you was you I would up-vote by 5 not -- Kim improved the answer.
--SA
Ed Nutting 9-May-11 12:35pm    
Well now I will definitely agree, 5 :)
Try this

C#
MessageBox.Show("Record save Successfully!!", messageBox title, MessageBoxButtons.OK, MessageBoxIcon.Information);
 
Share this answer
 
v2
Comments
Ed Nutting 8-May-11 5:40am    
That should work, my 5 :)

(Edited to add pre (code) block formatting ;) )
Sergey Alexandrovich Kryukov 8-May-11 11:55am    
Yes, as trivial as that; my 5.
--SA
Kim Togo 9-May-11 2:40am    
Good answer, my 5.
Dalek Dave 9-May-11 3:30am    
Good Call
Hi suvaaj,

I think this is the function you need :

MessageBox.Show("Record save Successfully!!", "Saved", MessageBoxButtons.OK, MessageBoxIcon.Information);


I hope this help,
:)
 
Share this answer
 
Comments
Ed Nutting 8-May-11 5:40am    
That should work, my 5 :)
Sergey Alexandrovich Kryukov 8-May-11 11:54am    
It's not your fault that it's so trivial, a 5.
--SA
Kim Togo 9-May-11 2:40am    
Good answer, my 5.
Dalek Dave 9-May-11 3:30am    
Gets a 5
MessageBox.Show("way to simple!!","This Question Is",0,MessageBoxIcon.Information)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900