Skip to content

Instantly share code, notes, and snippets.

@caiorss
Created December 20, 2016 00:19
Show Gist options
  • Save caiorss/ed68f71cf97815bdecee1483ff301a81 to your computer and use it in GitHub Desktop.
Save caiorss/ed68f71cf97815bdecee1483ff301a81 to your computer and use it in GitHub Desktop.
Load window icon from assembly
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