/syncfusion-winforms:syncfusion-winforms-grid-bag-layoutfrom Syncfusion WinForms Controls
How to use Syncfusion Windows Forms GridBagLayout control to arrange child controls in a flexible virtual grid with customizable rows, columns, spacing, and alignment. Use this skill whenever the user needs to create complex layouts with GridBagLayout, arrange controls dynamically, configure grid positioning, set up control spanning, or manage control alignment and sizing within a Windows Forms application.
Ships in Syncfusion WinForms Controls. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use this skill when you need to:
GridBagLayout is ideal for layouts where:
GridBagLayout is a layout manager that arranges child controls in a virtual grid where:
📄 Read: references/getting-started.md
📄 Read: references/grid-positioning.md
📄 Read: references/sizing-and-spacing.md
📄 Read: references/anchoring-and-fill.md
📄 Read: references/child-control-constraints.md
Here's a minimal example creating a 2×2 button grid:
// Create layout manager
GridBagLayout gridBagLayout1 = new GridBagLayout();
gridBagLayout1.ContainerControl = this;
// Create buttons
ButtonAdv button1 = new ButtonAdv { Text = "Button 1" };
ButtonAdv button2 = new ButtonAdv { Text = "Button 2" };
ButtonAdv button3 = new ButtonAdv { Text = "Button 3" };
ButtonAdv button4 = new ButtonAdv { Text = "Button 4" };
// Add to form
this.Controls.Add(button1);
this.Controls.Add(button2);
this.Controls.Add(button3);
this.Controls.Add(button4);
// Set constraints: (gridPosX, gridPosY, cellSpanX, cellSpanY, weightX, weightY, anchor, fill, insets, ipadX, ipadY)
gridBagLayout1.SetConstraints(button1, new GridBagConstraints(0, 0, 1, 1, 1, 1, AnchorTypes.Center, FillType.Both, new Insets(0, 0, 0, 0), 0, 0, false));
gridBagLayout1.SetConstraints(button2, new GridBagConstraints(1, 0, 1, 1, 1, 1, AnchorTypes.Center, FillType.Both, new Insets(0, 0, 0, 0), 0, 0, false));
gridBagLayout1.SetConstraints(button3, new GridBagConstraints(0, 1, 1, 1, 1, 1, AnchorTypes.Center, FillType.Both, new Insets(0, 0, 0, 0), 0, 0, false));
gridBagLayout1.SetConstraints(button4, new GridBagConstraints(1, 1, 1, 1, 1, 1, AnchorTypes.Center, FillType.Both, new Insets(0, 0, 0, 0), 0, 0, false));
Set all controls to equal weights and Fill.Both for uniform distribution:
gridBagLayout1.SetConstraints(control, new GridBagConstraints(x, y, 1, 1, 1, 1, AnchorTypes.Center, FillType.Both, ...));
Use CellSpanX to stretch a control across columns:
// Button spanning 3 columns
gridBagLayout1.SetConstraints(button1, new GridBagConstraints(0, 0, 3, 1, 1, 1, AnchorTypes.Center, FillType.Horizontal, ...));
Use different weight values to allocate more space to specific columns/rows:
gridBagLayout1.SetConstraints(button1, new GridBagConstraints(0, 0, 1, 1, 2, 1, AnchorTypes.Center, FillType.Both, ...)); // Column 0 gets 2x space
gridBagLayout1.SetConstraints(button2, new GridBagConstraints(1, 0, 1, 1, 1, 1, AnchorTypes.Center, FillType.Both, ...)); // Column 1 gets 1x space
Use Anchor property with Fill.None to position controls without resizing:
gridBagLayout1.SetConstraints(button1, new GridBagConstraints(0, 0, 1, 1, 1, 1, AnchorTypes.NorthEast, FillType.None, ...));
| Property | Purpose | Common Values |
|---|---|---|
| GridPosX | Column position | 0, 1, 2, ... |
| GridPosY | Row position | 0, 1, 2, ... |
| CellSpanX | Columns to span | 1, 2, 3, ... |
| CellSpanY | Rows to span | 1, 2, 3, ... |
| WeightX | Horizontal space weight | 0, 1, 2, or custom |
| WeightY | Vertical space weight | 0, 1, 2, or custom |
| Anchor | Alignment within cell | Center, North, East, South, NorthEast, etc. |
| Fill | Resizing behavior | None, Both, Horizontal, Vertical |
| Insets | Padding around control | new Insets(top, left, bottom, right) |
| IPadX | Width padding | 0-100+ |
| IPadY | Height padding | 0-100+ |
Wizard Button Navigation
Calculator Button Grid
Dialog Button Panel
Complex Form Layouts
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub syncfusion/boldcreate-plugins --plugin syncfusion-winforms113 skills in this plugin
/syncfusion-winforms-ai-assistviewGuide for implementing Syncfusion Windows Forms AI AssistView (SfAIAssistView) for building conversational AI interfaces in desktop applications. Use this when creating chat interfaces, AI assistants, or chatbots with Windows Forms. Supports OpenAI and Azure OpenAI integration, typing indicators, chat suggestions, message bubbles, custom views, input toolbar with attachments, response toolbar actions, and stop responding for interactive messaging experiences./syncfusion-winforms-autocompleteGuides implementation of the Syncfusion WinForms AutoComplete control for text input with auto-suggestion functionality. Use when users want to add autocomplete textboxes, implement auto-suggestion features, create search boxes with suggestions, enable URL/email autocomplete, or build type-ahead search functionality in Windows desktop applications. Covers data binding, customization, filtering, multi-column dropdowns, events, and all AutoComplete-specific features./syncfusion-winforms-autolabelGuides implementation of the Syncfusion WinForms AutoLabel control for automatic label positioning with form controls. Use when users want to add labels that automatically reposition when controls move, create form layouts with paired label-control units, implement complex form designs with FlowLayout, or ensure labels stay synchronized with their associated controls. Covers labeling controls, positioning, spacing, size settings, theming, and events.Other plugins' skills for the same job