我如何允许“标志”要在 WinForm PropertyGrid 中编辑枚举?
WinForm PropertyGrid 可以很好地处理标准枚举,但确实有一个用于标志枚举的内置编辑器。一定有人写过一个,我宁愿不重新发明这个威尔。
我正在寻找一个编辑器,在枚举的每个成员旁边放置一个复选框,以便用户可以控制所包含的成员。我的枚举看起来像:
[Flags]
public enum AutoPricingCalendar
{
Sunday = 1,
Monday = 2,
Tuesday = 4,
Wednesday = 8,
Thursday = 16,
Friday = 32,
Saturday = 64,
}
The WinForm PropertyGrid copes well with a standard enum but does does have a built in editor for a flag enum. Someone must have written one, I rather not reinvent the weel.
I am looking for an editor that puts a checkbox next to each member of the enum so the user can control the members that are included. My enum looks like:
[Flags]
public enum AutoPricingCalendar
{
Sunday = 1,
Monday = 2,
Tuesday = 4,
Wednesday = 8,
Thursday = 16,
Friday = 32,
Saturday = 64,
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CodeProject:一个 UITypeEditor,用于在属性浏览器中轻松编辑标志枚举属性
CodeProject: A UITypeEditor for easy editing of flag enum properties in the property browser