Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

How to save and retrieve icon in database using c# .net windows application?

I want to change windows form icon at run time or using c# .net windows application.
It's a need for application.

Please help me.

Thanks in Advance.

Ankit Agarwal
Software Engineer
Posted

1 solution

To change the icon, you simply change the Icon property. See Form.Icon[^].

In order to create the Icon, if you get the Icon data as a stream you can utilize Icon Constructor (Stream)[^]

Getting the stream depends how you store the data in the database but if you use for example file stream, then perhaps this article would help How to store and fetch binary data into a file stream column[^]
 
Share this answer
 

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