[英]How do I get the WinForm Designer to totally ignore a property on a custom control?
This must be a FAQ, but I can't find a duplicate question! 这必须是一个常见问题解答,但我找不到重复的问题!
There are lot of different attributes that control what the WinForm Designer does with properties on a custom control, I am never clear on the one I should use in this case. 有许多不同的属性可以控制WinForm设计器使用自定义控件上的属性,在这种情况下,我永远都不清楚应该使用哪种属性。
I am looking for: 我在寻找:
Background. 背景。
The code that is giving me the problem is: 给我的问题的代码是:
this.eventListControl.FilterSets =
((SystList<FilterSet>)(resources.GetObject("eventListControl.FilterSets")));
The FilterSets property should never have been touched by the winforms designer; WinForms设计人员绝对不应接触FilterSets属性。 it is now not Serializable and MsDev falls over every time a form that used the eventListControl is changed!
现在它无法序列化,并且每次更改使用eventListControl的表单时,MsDev都会掉落!
I think you can use [Browsable (false)]
and [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
我认为您可以使用
[Browsable (false)]
和[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
The second attribute prevents the property from appearing in InitializeComponent
第二个属性阻止该属性出现在
InitializeComponent
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.