{"id":17,"date":"2023-03-21T03:27:00","date_gmt":"2023-03-21T03:27:00","guid":{"rendered":"https:\/\/brunocm.azurewebsites.net\/?page_id=17"},"modified":"2025-10-09T14:04:07","modified_gmt":"2025-10-09T12:04:07","slug":"part-3-adding-an-icon","status":"publish","type":"page","link":"https:\/\/brunocm.azurewebsites.net\/?page_id=17","title":{"rendered":"Part 3 &#8211; Adding an icon"},"content":{"rendered":"<h1>Adding a nice icon<\/h1>\n<p>This is a small addition that makes things look better.<\/p>\n<p>Find a nice (and free to use) icon file or create your own if you know how to do it.<\/p>\n<p>Go back to Visual Studio. In the solution explorer, right-click on your project (not the solution!)<br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-51\" src=\"\/wp-content\/uploads\/2023\/03\/image11-300x58.png\" alt=\"\" width=\"300\" height=\"58\" srcset=\"\/wp-content\/uploads\/2023\/03\/image11-300x58.png 300w, \/wp-content\/uploads\/2023\/03\/image11.png 380w\" sizes=\"(max-width: 300px) 85vw, 300px\" \/><\/p>\n<p>And select &#8220;Properties&#8221;.<\/p>\n<p>In the new window, select the &#8220;Resources&#8221; section and click on the text to create a resource file.<br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-52 size-full\" src=\"\/wp-content\/uploads\/2023\/03\/image12.png\" alt=\"\" width=\"690\" height=\"274\" srcset=\"\/wp-content\/uploads\/2023\/03\/image12.png 690w, \/wp-content\/uploads\/2023\/03\/image12-300x119.png 300w\" sizes=\"(max-width: 690px) 85vw, 690px\" \/><\/p>\n<p>Now that the resource file is ready, open the second menu and select &#8220;Add Existing File\u2026&#8221;<br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-53\" src=\"\/wp-content\/uploads\/2023\/03\/image13-300x142.png\" alt=\"\" width=\"300\" height=\"142\" srcset=\"\/wp-content\/uploads\/2023\/03\/image13-300x142.png 300w, \/wp-content\/uploads\/2023\/03\/image13.png 340w\" sizes=\"(max-width: 300px) 85vw, 300px\" \/><\/p>\n<p>Browse your disk and add your ICO file.<br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-54 size-full\" src=\"\/wp-content\/uploads\/2023\/03\/image14.png\" alt=\"\" width=\"188\" height=\"144\" \/><br \/>\n<em>Note the icon name somewhere!<\/em><\/p>\n<p>Its time to add it to our XML extension file.<\/p>\n<p>Add the following lines at the beginning of the ActionDescription section.<\/p>\n<pre>&lt;ImagesDescription&gt;\n   &lt;ResourceAssembly&gt;\n      &lt;Assembly&gt;C:\\Program Files (x86)\\myCompany\\myextension\\MyFirstExtension.dll&lt;\/Assembly&gt;\n      &lt;Type&gt;MyFirstExtension.Properties.Resources.resources&lt;\/Type&gt;\n   &lt;\/ResourceAssembly&gt;\n   &lt;ImageResourceName&gt;collinfo&lt;\/ImageResourceName&gt;\n&lt;\/ImagesDescription&gt;<\/pre>\n<p>Like this:<\/p>\n<pre>&lt;ActionDescription Class=\"AssemblyType\" DisplayName=\"show collections\" MnemonicDisplayName=\"show collections\" Description=\"Shows the list of collection IDs this device is member of\"&gt;\n   &lt;ImagesDescription&gt;\n      &lt;ResourceAssembly&gt;\n         &lt;Assembly&gt;C:\\Program Files (x86)\\myCompany\\myextension\\MyFirstExtension.dll&lt;\/Assembly&gt;\n         &lt;Type&gt;MyFirstExtension.Properties.Resources.resources&lt;\/Type&gt;\n      &lt;\/ResourceAssembly&gt;\n      &lt;ImageResourceName&gt;collinfo&lt;\/ImageResourceName&gt;\n   &lt;\/ImagesDescription&gt;\n   &lt;ShowOn&gt;\n      &lt;string&gt;ContextMenu&lt;\/string&gt;\n      &lt;string&gt;DefaultHomeTab&lt;\/string&gt;\n   &lt;\/ShowOn&gt;\n   &lt;ActionAssembly&gt;\n      &lt;Assembly&gt;C:\\Users\\m328996\\Documents\\Visual Studio 2015\\Projects\\MyFirstExtension\\MyFirstExtension\\bin\\x86\\Release\\MyFirstExtension.dll&lt;\/Assembly&gt;\n      &lt;Type&gt;MyFirstExtension.DeviceTools&lt;\/Type&gt;\n      &lt;Method&gt;deviceCollections&lt;\/Method&gt;\n   &lt;\/ActionAssembly&gt;\n&lt;\/ActionDescription&gt;<\/pre>\n<p>Try again!<br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-55 size-medium\" src=\"\/wp-content\/uploads\/2023\/03\/image15-300x268.png\" alt=\"\" width=\"300\" height=\"268\" srcset=\"\/wp-content\/uploads\/2023\/03\/image15-300x268.png 300w, \/wp-content\/uploads\/2023\/03\/image15.png 306w\" sizes=\"(max-width: 300px) 85vw, 300px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Adding a nice icon This is a small addition that makes things look better. Find a nice (and free to use) icon file or create your own if you know how to do it. Go back to Visual Studio. In the solution explorer, right-click on your project (not the solution!) And select &#8220;Properties&#8221;. In the &hellip; <a href=\"https:\/\/brunocm.azurewebsites.net\/?page_id=17\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Part 3 &#8211; Adding an icon&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":""},"_links":{"self":[{"href":"https:\/\/brunocm.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/pages\/17"}],"collection":[{"href":"https:\/\/brunocm.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/brunocm.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/brunocm.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/brunocm.azurewebsites.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17"}],"version-history":[{"count":1,"href":"https:\/\/brunocm.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/pages\/17\/revisions"}],"predecessor-version":[{"id":81,"href":"https:\/\/brunocm.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/pages\/17\/revisions\/81"}],"wp:attachment":[{"href":"https:\/\/brunocm.azurewebsites.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}