查看: 75|回覆: 0

WinForms 内置的公共系统级别编辑器

[複製鏈接]

3

主題

0

回帖

0

積分

热心网友

金币
0
閲讀權限
220
精華
0
威望
0
贡献
0
在線時間
0 小時
註冊時間
2010-10-14
發表於 2026-4-14 14:48:00 | 顯示全部樓層 |閲讀模式

在 WinForms 的设计时库(以 System.Design、System.Drawing.Design 和 System.Windows.Forms.Design 为主)中,微软官方提供了 约 40~50 个 内置的公共系统级别编辑器(继承自 UITypeEditor)。

由于这些编辑器内置在 Visual Studio 和标准库中,因此在跨进程的外进程设计器(.NET Core/.NET 10)环境中,大部分都是可以直接通过字符串定义和引用的。

以下是将它们按照功能分类的常用自带编辑器列表,你可以参考这些看是否有与你的需求场景相似的。

1. 布局与标志下拉菜单类(带可视化面板)

这几个编辑器在属性面板中点击后,会下拉出一个特殊的控件UI:
• System.Windows.Forms.Design.BorderSidesEditor:针对左、上、右、下及四边的面板
• System.Windows.Forms.Design.AnchorEditor:四边锚点弹出的可视化面板。
• System.Windows.Forms.Design.DockEditor:停靠靠边设定的中心九宫格弹出面板。
• System.Drawing.Design.ContentAlignmentEditor:对齐方式(类似九宫格对齐选择器)。

2. 交互式对话框类(弹出新窗口)

点击后会弹出一个独立窗体的编辑器:
• System.ComponentModel.Design.MultilineStringEditor:用于输入多行文本的弹窗。
• System.Windows.Forms.Design.FileNameEditor:弹出打开文件选择对话框(OpenFileDialog(ref string, string, string))。
• System.Windows.Forms.Design.FolderNameEditor:弹出选择目录对话框(FolderBrowserDialog)。
• System.ComponentModel.Design.CollectionEditor:标准的集合编辑器(如 DataGridView.Columns,泛型列表等)。
• System.Windows.Forms.Design.StringCollectionEditor:专门处理 List 的集合编辑。
• System.Windows.Forms.Design.ListControlStringCollectionEditor:针对 ListBox 或 ComboBox 选项的字符串集合编辑。
• System.ComponentModel.Design.ArrayEditor:数组编辑器窗体。
• System.Windows.Forms.Design.FormatStringEditor:数据绑定或显示格式的格式化字符串编辑器组件(数字、日期、货币的格式设置)。
• System.Windows.Forms.Design.MaskPropertyEditor:正则表达式与掩码输入编辑器(用于 MaskedTextBox)。

3. 图形影像系统类

• System.Drawing.Design.ColorEditor:内置的“系统/网络/自定义”多选项卡颜色选择面板下拉控件。
• System.Drawing.Design.FontEditor:弹出经典的字体选择弹窗。
• System.Drawing.Design.FontNameEditor:只下拉选择系统可用字体名称(而不弹窗)。
• System.Drawing.Design.ImageEditor:基础图片选择器对话框。
• System.Drawing.Design.BitmapEditor / IconEditor:图片编译器的具体图片类型派生版。
• System.Drawing.Design.CursorEditor:下拉选择鼠标光标(带小光标图标)。

4. 树形、数据源与键鼠绑定类

• System.Windows.Forms.Design.ShortcutKeysEditor:用于配置快捷键(Ctrl+Shift+A 等)的按键组合下拉捕捉框。
• System.Windows.Forms.Design.DataMemberFieldEditor:用于下拉绑定 DataSource 下包含的数据字段。

回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即注册

本版積分規則

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部