How to show image on form like MessageBoxIcon.Stop image in WindowsFormsApplication in c# 2008
How to show image on form like MessageBoxIcon.Stop image in WindowsFormsApplication in c# 2008
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use one of the icons from the SystemIcons class.
The linked MSDN article has an example.
It’s not a very good example, as (a) it doesn’t Dispose the Bitmap it creates, (b) it doesn’t use try/finally to ensure the Graphics object it creates is Disposed in the event of an Exception, and (c) a button click event handler is not the right place to be drawing.
I would handle the
Form‘s Paint event, and draw it as follows: