1.定义一个继承ControlDesigner 的类
public class MyControlDesigner:System.Windows.Forms.Design.ControlDesigner { protected override void PreFilterProperties(IDictionary properties) { // TODO: 添加 MyTextBoxDesigner.PreFilterProperties 实现 base.PreFilterProperties (properties); properties.Remove("AccessibleDescription"); properties.Remove("Anchor"); } }
2.重写PreFilterProperties
[System.ComponentModel.Designer(typeof(MyControlDesigner))] public class MyTextBox : System.Windows.Forms.TextBox { ... }