Token导航 LogoToken导航TokenDH.com
前端设计只读github未标认证来源可访问许可证需确认审计通过

syncfusion-winforms-grid-bag-layoutsyncfusion winforms 网格包布局

Agent Skill

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

总安装

724

周安装

29

GitHub Stars

公开资料未说明

下载量

234
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:syncfusion-winforms-grid-bag-layout(syncfusion winforms 网格包布局)
来源仓库:https://github.com/syncfusion/winforms-ui-components-skills
仓库路径:skills/syncfusion-winforms-grid-bag-layout
安装命令:
npx skills add https://github.com/syncfusion/winforms-ui-components-skills --skill syncfusion-winforms-grid-bag-layout
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/syncfusion/winforms-ui-components-skills --skill syncfusion-winforms-grid-bag-layout

简介

基于网格包模型的灵活布局管理器,实现精细化的控件排列控制。

  • 适合构建复杂表单、数据编辑界面或需要精确对齐的多列布局场景。
  • AI 宿主可依据此技能自动生成符合规范的布局代码,减少手动调试时间。
  • 需注意与其他布局管理器(如 TableLayoutPanel)混用时可能产生约束冲突。
  • 首次集成时应创建最小化测试用例,确认行为符合预期后再扩展应用。

SKILL.md

Implementing GridBagLayout in Windows Forms

When to Use This Skill

Use this skill when you need to:

  • Arrange multiple child controls in a flexible grid layout
  • Create responsive layouts that span multiple rows and columns
  • Configure control positioning, sizing, and alignment
  • Manage complex control layouts beyond simple grid or flow arrangements
  • Set up constraints for child controls with precise positioning
  • Create layouts like wizard navigation buttons or calculator button grids

GridBagLayout is ideal for layouts where:

  • Controls need variable row/column sizing
  • Controls must span multiple cells
  • You need fine-grained control over spacing and alignment
  • Complex nested layouts are required

Component Overview

GridBagLayout is a layout manager that arranges child controls in a virtual grid where:

  • Rows and columns have variable sizes (unlike GridLayout)
  • Individual controls can span multiple cells
  • Each control's position and sizing is determined by constraints
  • Extra space is distributed based on weight properties

Key Features

  • Grid Positioning: Place controls at specific grid coordinates
  • Cell Spanning: Allow controls to occupy multiple rows/columns
  • Weight Distribution: Control how extra space is allocated
  • Anchor & Fill: Position and resize controls within their allocated space
  • Spacing Control: Add padding and insets around controls

Documentation Guide

Getting Started

📄 Read: references/getting-started.md

  • Assembly deployment and NuGet packages
  • Creating a Windows Forms project with GridBagLayout
  • Adding controls through Designer
  • Adding controls programmatically in C# and VB.NET

Grid Positioning & Layout Structure

📄 Read: references/grid-positioning.md

  • Understanding virtual grid concept
  • GridPostX and GridPostY properties
  • Setting grid coordinates for controls
  • Overlapping controls in same cells

Sizing & Space Distribution

📄 Read: references/sizing-and-spacing.md

  • WeightX and WeightY properties
  • How weight affects space distribution
  • Weight-to-column/row mapping
  • GetLayoutWeights() method usage

Anchoring & Fill Behavior

📄 Read: references/anchoring-and-fill.md

  • Anchor property and justification options
  • Fill property (None, Both, Horizontal, Vertical)
  • Insets for padding around controls
  • IPadX and IPadY for preferred size adjustment

Child Control Constraints

📄 Read: references/child-control-constraints.md

  • CellSpanX and CellSpanY for multi-cell controls
  • GridBagConstraints object structure
  • SetConstraints() method for programmatic configuration
  • GetConstraints() and GetConstraintsRef() methods
  • Designer vs code-based constraint setup

Quick Start Example

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));

Common Patterns

Pattern 1: Equal-Sized Grid

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, ...));

Pattern 2: Control Spanning Multiple Columns

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, ...));

Pattern 3: Asymmetric Space Distribution

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

Pattern 4: Aligned Controls with No Fill

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, ...));

Key Constraint Properties

PropertyPurposeCommon Values
GridPostXColumn position0, 1, 2,...
GridPostYRow position0, 1, 2,...
CellSpanXColumns to span1, 2, 3,...
CellSpanYRows to span1, 2, 3,...
WeightXHorizontal space weight0, 1, 2, or custom
WeightYVertical space weight0, 1, 2, or custom
AnchorAlignment within cellCenter, North, East, South, NorthEast, etc.
FillResizing behaviorNone, Both, Horizontal, Vertical
InsetsPadding around controlnew Insets(top, left, bottom, right)
IPadXWidth padding0-100+
IPadYHeight padding0-100+

Common Use Cases

Wizard Button Navigation

  • Multiple buttons arranged horizontally at bottom
  • Use CellSpanX and equal weights for uniform distribution

Calculator Button Grid

  • 4×4 grid of numeric buttons
  • 1×1 constraints with equal weights and Fill.Both

Dialog Button Panel

  • OK, Cancel, Help buttons in a row
  • Different sizes using Anchor and Insets

Complex Form Layouts

  • Labels, text boxes, and buttons in organized grid
  • Use CellSpanX for full-width controls
  • Asymmetric weights for proportional sizing

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.25%
按下载量换算80

Claude

32.88%
按下载量换算77

Cursor

20.3%
按下载量换算48

Gemini CLI

10.19%
按下载量换算24

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills