
The syntax for adding an icon in Markdown is $(iconIdentifier): $ ( alert ) Icons can be used in Markdown labels in hovers, in the StatusBarItem text and QuickPickItem label API. The association of icon identifier to an actual icon font glyph is then done in the product icon theme. The icon identifier is what's used in UI components. In order to allow this, all product icons are identified by an ID. Extensions can provide new Product Icon Themes to redefine these icons and give VS Code a new appearance. The product icons that ship with VS Code are contained in the Codicon icon font and form the default product icon theme. These icons are product icons as opposed to file icons, which are used next to file names throughout the UI. You will need to make sure that your form imports the System.IO namespace.Visual Studio Code contains a set of built-in icons that are used in views and the editor, but can also be used in hovers, the status bar, and by extensions. Paste the preceding code into a Windows Form, and call the ExtractAssociatedIconExample method from the form's constructor or Load event-handling method. ' If not, add the image to the image list. ' for this extension, using the extension as a key. ' Check to see if the image collection contains an image Me.ClientSize = New (292, 266)ĭim dir As New System.IO.DirectoryInfo("c:\")ĭim iconForFile As Icon = SystemIcons.WinLogo ' Initialize the ListView, ImageList and Form. If not, add the image to the image list.

for this extension, using the extension as a key. Check to see if the image collection contains an image and set the icon to the icon extracted from the file.įoreach (System.IO.FileInfo file in dir.GetFiles())


For each file in the c:\ directory, create a ListViewItem Initialize the ListView, ImageList and Form. The following code example demonstrates how to extract the icon associated with a file and display the file name and its associated icon in a ListView control. You can do this easily by using the ExtractAssociatedIcon method. When displaying files in a list control or table control, you may want to display the icon representing the file type next to each file name. For example, Microsoft Word documents contain an icon that identifies them as Word documents. Many files have embedded icons that provide a visual representation of the associated file type.
