Properties.Resources.yourResourceNameHere
or
Form1.Properties.Resources.yourResourceNameHere
Yup, its that simple, of course though this can get more complex. In my project I wanted to put some icons into an ImageList, but I wanted to put all my embedded icons into it and then assign them keys so that other parts of my code could find them. (This could obviously be improved, especially where it checks to see what type of resource it is)
foreach (DictionaryEntry resourceEntry in Properties.Resources.ResourceManager.GetResourceSet( System.Globalization.CultureInfo.CurrentUICulture, true, true)); { if (resourceEntry.Value.GetType().ToString() == "System.Drawing.Icon") { imageList.Images.Add((System.Drawing.Icon) Properties.Resources.ResourceManager.GetObject( resourceEntry.Key.ToString())); imageList.Images.SetKeyName(imageList.Images.Count - 1, resourceEntry.Key.ToString()); } }
It looks a bit messy here, but it looks much better in a proper editor :)
