warp-toolstrip-icons

Configures DPI-aware symbol-font glyph icons on WinForms ToolStrip items via the ConfigureItem extension method.

1|1|Updated Jun 12, 2022
One-click install
npx skills add https://github.com/KlausLoeffelmann/WinFormsDevTools --skill warp-toolstrip-icons-klausloeffelmann
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: warp-toolstrip-icons
Source: https://github.com/KlausLoeffelmann/WinFormsDevTools/tree/main/.github/skills/WARP-ToolStripIcons
Command: npx skills add https://github.com/KlausLoeffelmann/WinFormsDevTools --skill warp-toolstrip-icons-klausloeffelmann

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires WarpToolkit.WinForms, WarpToolkit.WinForms.Extensions.

What problem does it solve? Adding icons to WinForms ToolStrip, MenuStrip, and ContextMenuStrip items traditionally requires bitmap resources, ImageList plumbing, and manual DPI handling. This Skill shows how to assign crisp, vector-based glyph icons from symbol fonts (like Segoe Fluent Icons) using the WarpToolkit ConfigureItem extension method, eliminating image assets entirely. ## Core Features & Use Cases - Glyph icon assignment: Call ConfigureItem on any ToolStripItem with a symbol enum (e.g. FluentSymbols.AllSymbols) to render a font-based icon with optional click handler and tooltip wiring. - DPI-aware rendering: Icons are drawn from the owning ToolStrip's HDC at ImageScalingSize, so they scale correctly across display DPI settings without extra code. - Theme re-skinning: Re-call ConfigureItem with removeBeforeAdd: true to re-tint glyphs after a dark/light mode switch without duplicating event handlers. - Use Case: You are modernizing a WinForms app's menus. Instead of embedding PNG resources, you call _tsmSave.ConfigureItem(symbol: FluentSymbols.AllSymbols.Save, tooltipText: "Save") in a SetupCommands() method after InitializeComponent(). ## Quick Start Ask the AI to add FluentSymbols glyph icons to your ToolStrip menu items using the WarpToolkit ConfigureItem extension method in a SetupCommands method called after InitializeComponent.

Frequently Asked Questions about warp-toolstrip-icons

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add icons to WinForms ToolStrip items without image resources?▼

Use the ConfigureItem extension method from WarpToolkit.WinForms.Extensions.UI, passing a symbol enum like FluentSymbols.AllSymbols. It renders the enum value as a Unicode code point from a symbol font, so no PNG, ICO, or ImageList resources are needed.

How to make ToolStrip icons DPI-aware in WinForms?▼

Leave the ConfigureItem size parameter at its default of 0 so the glyph is drawn at the owning ToolStrip's ImageScalingSize. The bitmap is created from the ToolStrip's HDC, which automatically picks up the correct display DPI.

Why does ConfigureItem throw a NullReferenceException?▼

ConfigureItem requires the item's Owner property to be set, meaning the item must already be added to its parent ToolStrip, MenuStrip, or ContextMenuStrip. Calling it inside InitializeComponent or before parenting leaves Owner null and causes the exception.

Can I use a custom symbol font for ToolStrip icons?▼

Yes, define an enum annotated with [SourceFontName("Your Font Name")] whose values are Unicode code points in that font, then pass enum values to ConfigureItem. Without the attribute, GetFont throws an InvalidOperationException.

How do I update ToolStrip icons when the app theme changes?▼

Call ConfigureItem again after the theme switch, optionally passing a new foreColor and setting removeBeforeAdd: true so the click handler is not subscribed twice. By default the glyph color follows the owner's ForeColor automatically.