Wisej.NET comes with a powerful icon system built around embedded resources and the resource.wx handler. This system is optimized for SVG icons: it can recolor monochromatic icons on the fly and efficiently caches them in the browser.
That said, some applications prefer or already rely on icon fonts—for example Font Awesome—to keep visual consistency with existing web assets or to take advantage of a large icon catalog.
The good news: using icon fonts in Wisej.NET is simple and fully supported through standard HTML and CSS.
This post shows how to:
Add an icon font (Font Awesome) to a Wisej.NET application
Render icons inside Wisej.NET controls
Use icons in labels, buttons, and DataGridView cells
Detect clicks on specific icons using the role attribute
Wisej.NET applications include a Default.html file, which is the perfect place to load external CSS resources. To use Font Awesome, simply add the stylesheet link to Default.html.
Example: Default.html
Once this file is loaded, Font Awesome icons are available everywhere in your Wisej.NET application.
By default, Wisej.NET controls treat text as plain text. To render HTML (including <i> tags for icons), you must enable it explicitly.
This applies to many controls, including:
LabelButtonDataGridView cellsCheckBoxRadioButtonLinkLabelWith HTML enabled, adding an icon is straightforward.
<i> is the Font Awesome icon element
fa-brands fa-github selects the GitHub brand icon
Inline styles (or CSS classes) control color and size
Buttons work the same way as labels.
This makes it easy to create visually rich buttons without managing separate image resources.
HTML-enabled cells allow you to embed icons directly into grid data.
You can mix icons and text freely in each cell.
A powerful feature of Wisej.NET is the ability to detect clicks inside HTML content. By adding a role attribute to an icon, you can identify which element was clicked.
Subscribe to the MouseClick event:
No need for separate buttons or controls
Keeps UI compact and expressive
Perfect for grids, toolbars, and inline actions
Automatic recoloring
Optimized caching
Best integration with themes
Huge icon libraries
Familiar HTML/CSS workflow
Ideal for porting existing web UIs
Both approaches can coexist in the same application, letting you choose the right tool for each scenario.
Wisej.NET makes it easy to integrate traditional web assets like icon fonts without sacrificing performance or flexibility. By enabling HTML content and loading a CSS library such as Font Awesome, you can:
Add rich icons to any control
Style them using standard CSS
Handle clicks at the element level
This approach is especially useful for applications migrating from web technologies or needing access to large icon sets. Happy coding!