Click here to Skip to main content
15,893,508 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
how to change the color of message box and caption in c#.
and how to insert an image into database from a picturebox in c#
Posted

MessageBox can't be overriden to change the style of it. However you can create one of your own. You can create a simple Window and then add content in the form of string to it, that will be shown to the user and a simple OK button. Which would close the window upon click.

Remember, a custom MessageBox won't be a MessageBox, it would be some other class object, and can be a simple Window too. With some content, and a button as the default UI. Styles can be applied as C# object properties such as Background, Foreground etc.

Database have their own things and maths. In Database you save an image in the form of binary. Every file is saved in the form of binary, so that you can extract or insert the binary of the file to it. It is then upto you, to properly get the binary back and display it as an image.

Note: The Image datatype in SQL Server is for storing the binary of the file, not the image itself.
 
Share this answer
 
Comments
Member 11084185 16-Sep-14 12:27pm    
sir you want to say i would have create a winform for this purpose? except of message box..?
as i will click the button that winform will open .?
Afzaal Ahmad Zeeshan 16-Sep-14 13:37pm    
Yes, you can create a new WinForm window for this purpose and show it. Upon showing, add a few content to it. And upon clicking the OK button close that window. :)

Yes, upon click, open that window by adding some data to it.
Member 11084185 17-Sep-14 1:35am    
oh thanks sir i got it. :) but if i add delete button in winform then how will it work? as yes button works in dialog box.
Afzaal Ahmad Zeeshan 17-Sep-14 10:16am    
You can then add a new event that will execute upon a click on that button. The event has to be handled, no matter how you handle it. Delete button would be given a name like "DeleteButton" and a new event as "DeleteButton_Click" and in this event you will handle the event to delete an object etc.
Member 11084185 18-Sep-14 1:28am    
if there are three buttons yes,no and cancel .as user click yes and no form must be close. but as user click yes for deleting data ... how it should be???

  1. You can't restyle the default message box on a case by case basis.  You could of course create your own message box that allows customization.
  2. See this article: Sending/Receiving PictureBox Image in C# To/From Microsoft SQL SERVER[^]


Please don't ask multiple disparate questions in the same post.

/ravi
 
Share this answer
 
Comments
Member 11084185 16-Sep-14 12:29pm    
how is it possible to create a custom messagebox with desire requirements... can you help plzz..??
Ravi Bhavnani 16-Sep-14 12:34pm    
> how is it possible to create a custom messagebox with desire requirements
See this article: http://www.codeproject.com/Articles/327212/Custom-Message-Box-in-VC

> can you help plzz..??
No. You will have to do your own work. A simple Google search (which I'm going to assume you didn't bother to do) would have revealed the above link.

/ravi

Member 11084185 16-Sep-14 13:09pm    
i have searched but ... infact i am a student m jst learning about c#. so

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