'Does .NET have icon collections?
Does .NET framework have a collection of icons for use in Windows Forms or WPF application somewhere? How does one use it? For example, how do I use it as an application window icon?
I recall, if you want to display a message box there is a choice to show different icons, I suppose there are more icons in the framework?
Solution 1:[1]
If you're using a full edition (not Express) of Visual Studio, an image library is included for you to use freely in your applications (including commercial products!). The primary advantage of using icons from this library is that they are very similar or identical to those that are used in Windows and other Microsoft products, such as Office and Visual Studio, so your users will find them very familiar. This library includes images, icons, and animations and is installed on your computer when you install Visual Studio. For example, if you're using VS 2010, the image library is located here:
..\Program Files\Microsoft Visual Studio 10.0\Common7\VS2010ImageLibrary\1033
To use the files, you first need to extract them from the zip file.
See this entry on th Visual Studio Team Blog site for more information. As the page explains, the one caveat to using the images is that they must be consistent with their specified usage ("In other words, don't use the 'Cut' image for a 'Copy' command."), but this really just makes sense.
If you can't find the icons you're looking for included with Visual Studio's image library, there are plenty of free icon packs available on the Internet. Several of the other posts mention their picks, but I'm a huge fan of Fugue Icons. Similar to the Silk icons, they're free for use in your applications as long as you provide attribution. Otherwise, you can purchase a royalty-free license for a very reasonable price.
If you have money to spend, GlyFX sells high quality icons and graphics, many of which have a similar style as those found in Windows or other Microsoft products.
And finally, if you're just looking for a particular icon, you can use one of these free icon search engines:
Solution 2:[2]
The library is no longer included beginning with VisualStudio 2012. You can download here though: http://www.microsoft.com/en-us/download/details.aspx?id=35825
They updated it for 2022 in early February 2022. Content is similar across releases, so you only need to download the latest release.
The 2022 release has 12.1 MB of content and ~4000 icon types (SVG/PNG/XAML). This release got rid the folder structure entirely and got rid of ~5000 variants (like save_grey and RunTest_inverse). It also renamed many icons again (such as SaveStatusBar became StatusBarSave) and dropped the _16x suffix on all icons. The icons do look cleaner across the board and have a more consistent feel than past releases.
The 2019 release has 10.3 MB of content and 4085 icon types (SVG/PNG/XAML). This release got rid of many BMP icons, as well as the size variations used for overlays when making custom icons (SM/MD). It also added some handy icons (CloseAll, Trash, AlignCenter, AlignMiddle, SkipFile, SmartFilter, Sort, StatusReady, Target, UserGroup). It changed folder name conventions (such as AddRowToAbove became AddToRowAbove, column icons such as 1x and 2Columns became verbose such as TableColumn and SecondOfFourColumns, Silverlight/Azure prefixes were removed). The Save icon folder has 33 versions which together are 19.8KB, due to removed BMP and SM/MD types.
The 2017 release has 12.5 MB of content and 4013 icon types (BMP/SVG/PNG/XAML). This release largely abandoned the Adobe Illustrator (.ai) file type. Icons are still sorted into folders for the individual icon types that contain the different formats. Some icons have various size/resolution versions in each format up to 256x256 size and 32bit pixel depth. Most icons have different flavors such as grey/inverse/thin/thingrey/small/medium. For example, the Save icon folder has 40 versions which together are 24.9KB. The absence of the archive folder, the 2010 legacy icons, and the Adobe Illustrator (.ai) icons together makes this release nice and compact again.
The 2015 release has 2.9 GB of content and 4222 icon types (AI/BMP/SVG/PNG/XAML). This release started offering multiple flavors of each icon type such as grey/inverse/thin/thingrey/small/medium. Icons are now sorted into folders for the individual icon types that contain the different formats and flavors. Some icons have various size/resolution versions in each format up to 256x256 size and 32bit pixel depth. The Adobe Illustrator (.ai) file type adds most of the bulk to this release. For example the Save icon folder has 84 versions which together are 5.84MB, and the .ai files are 5.69MB of this.
The 2013 release has 285.6 MB of content and 2793 icon types (BMP/ICO/PNG/XAML). Icons were sorted by function group, then by image type (726 action, 1494 concept, 753 objects as counter by png). It also has 788 legacy icons for VS2010 and an archive folder with 2010 and 2012 icons. This release started offering multiple flavors of each icon type.
The 2012 release has 19.4 MB of content and 2658 icon types (BMP/ICO/PNG/XAML). Icons were sorted by function group, then by image type (1093 common, 722 action, 91 annotation, 752 objects as counted by PNG type). Most icons available as 16x16 size and 32bit pixel depth.
Solution 3:[3]
I use famfamfam's Silk Icons in several applications and really like them (they're free but you have to mention you're using them in your app + of course you can donate).
Solution 4:[4]
If you have Visual Studio (not Express) then you have access to many of the windows icons:
The Visual Studio 2010 Image Library contains application images that appear in Microsoft Windows, the Office system, Microsoft Visual Studio, and other Microsoft software. You can use this set of over 1,000 images to create applications that look visually consistent with Microsoft software.
This file is typically installed in ..\Program Files\Microsoft Visual Studio 10.0\Common7\VS2010ImageLibrary\1033.
Ref.: Visual Studio Image Library
How to: Install the Visual Studio Image Library
Licensing is talked about here: Tips and Tricks: Visual Studio 2010 Image Library
Solution 5:[5]
AFAIK there isn't a collection of pre-built icons - but there a millions of high quality icons available on the web if you just search for them.
Once you have an icon (.ico) file, you can add it to your project resources. Just open the Resources.resx file, and at the top switch it to view Icons, and then "Add existing file..."
Then, to set the application icon, get Properties on your Project and in the Application tab (at the bottom) choose the icon in the drop-down box.
For any Form, set this.Icon = Resources.IconName;
to use it as the Form's icon.
Solution 6:[6]
In addition to the great recommendations, you could use the glyphIcons Set, which is well suited for the currently popular Flat and puristic Designs. Include them in in your *.resx, and load them (presuming you are using C#):
System.ComponentModel.ComponentResourceManager resources =
new System.ComponentModel.ComponentResourceManager(typeof(MyForm));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("statusnormalorsmthg.Icon")));
or, by directly reading the Resources:
this.Icon = new Icon("Resources/statusnormalorsmthg.ico");
Solution 7:[7]
Use the metro package ... it has various icons that suit for almost every thing ... it's free and you can color it and control it in any way you want ... https://github.com/MahApps/MahApps.Metro.IconPacks
Solution 8:[8]
I could not find the image library on my machine. I don't think it's include with the install.
I did find a link to download all the collections:
https://www.microsoft.com/en-us/download/details.aspx?id=35825
Solution 9:[9]
No. The icons of the message boxes are part of Windows. .NET itself does not provide icons or images.
Solution 10:[10]
Use an ImageList control to store your icons or Managed Resources file.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow