Created
December 20, 2016 00:19
-
-
Save caiorss/ed68f71cf97815bdecee1483ff301a81 to your computer and use it in GitHub Desktop.
Load window icon from assembly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Resources; | |
class MyClass : Form { | |
MyClass() { | |
// Stuff | |
ResourceManager resources = new ResourceManager("AssemblyName.ResourceFile", GetType().Assembly); | |
this.Icon = ((System.Drawing.Icon)(resources.GetObject("ResourceName"))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment