mcpbeat

Managing Winforms Rendering

microsoft/managing-winforms-rendering

> Implements custom painting and rendering in WinForms using GDI and GDI+. Use when overriding OnPaint or OnPaintBackground, creating owner-drawn controls, working with Graphics objects, drawing primitives (DrawLine, DrawRectangle, FillEllipse), measuring or rendering text with TextRenderer or Graphics.DrawString, handling Paint events, using BufferedGraphics for double-buffering, or managing resource disposal for Pen, Brush, Font, and Graphics objects. Also triggers for "custom paint WinForms", "override OnPaint", "Graphics object", "GDI+ rendering", "DrawString", "TextRenderer", "owner-drawn control", "double buffer", and "dispose Graphics resources".

5k tokens
context cost
the whole folder, loaded on every use
2
files
instructions only
0
copies elsewhere
how many repositories repackaged it
17
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/microsoft/upgrade-agent-plugins --skill managing-winforms-rendering

What comes with it

19 083 bytes besides the instruction
ref/detailed-guide.md

The instruction itself

5 sections, as written by the author

WinForms Custom Rendering Guide

Custom rendering in WinForms enables complete control over how controls paint themselves, from simple borders to complex visualizations using GDI+ (modern, object-oriented) and GDI (legacy, performance-optimized).

When to Use This Skill

Use this skill when:

  • Implementing custom OnPaint methods
  • Creating custom controls that render their content themselves
  • Working with Graphics, Pen, Brush, or Font objects
  • Drawing shapes, lines, or custom graphics in a DC painting context
  • Rendering and measuring text
  • Implementing double buffering to avoid flicker
  • Optimizing rendering performance
  • Supporting high-DPI displays
  • Implementing DarkMode-aware rendering (.NET 9+)
  • Troubleshooting paint artifacts or flicker
  • Managing GDI+ resource disposal
  • building-winforms-applications
  • managing-winforms-data-binding
  • managing-winforms-mvvm
  • managing-winforms-high-dpi-layout
  • creating-winforms-custom-controls

Detailed Guidance

Read Detailed guide for comprehensive patterns, examples, and troubleshooting.

Workflow

  • Confirm the scenario matches the triggers in this skill.
  • Apply the baseline pattern from this file.
  • Read Detailed guide for advanced or edge-case handling.
  • Validate changes with an actual build and runtime check.

How to use it

Copy the folder

Take microsoft/managing-winforms-rendering from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.