比如 Textbox 再属性编辑器里隐藏掉他默认的全部属性,然后全部自己定义。
[Browsable(false)] public bool WordWrap { get { return base.WordWrap; } set { base.WordWrap = value; } } [Browsable(false)] public bool Visible { get { return base.Visible; } set { base.Visible = value; } } [Browsable(false)] public bool UseWaitCursor { get { return base.UseWaitCursor; } set { base.UseWaitCursor = value; } } [Browsable(false)] public bool UseSystemPasswordChar { get { return base.UseSystemPasswordChar; } set { base.UseSystemPasswordChar = value; } } [Browsable(false)] public HorizontalAlignment TextAlign { get { return base.TextAlign; } set { base.TextAlign = value; } } [Browsable(false)] public object Tag { get { return base.Tag; } set { base.Tag = value; } } [Browsable(false)] public bool TabStop { get { return base.TabStop; } set { base.TabStop = value; } } [Browsable(false)] public int TabIndex { get { return base.TabIndex; } set { base.TabIndex = value; } } [Browsable(false)] public Size Size { get { return base.Size; } set { base.Size = value; } } [Browsable(false)] public bool ShortcutsEnabled { get { return base.ShortcutsEnabled; } set { base.ShortcutsEnabled = value; } } [Browsable(false)] public RightToLeft RightToLeft { get { return base.RightToLeft; } set { base.RightToLeft = value; } } [Browsable(false)] public Size MinimumSize { get { return base.MinimumSize; } set { base.MinimumSize = value; } } [Browsable(false)] public int MaxLength { get { return base.MaxLength; } set { base.MaxLength = value; } } [Browsable(false)] public ImeMode ImeMode { get { return base.ImeMode; } set { base.ImeMode = value; } } [Browsable(false)] public ScrollBars ScrollBars { get { return base.ScrollBars; } set { base.ScrollBars = value; } } [Browsable(false)] public int Right { get { return base.Right; }} [Browsable(false)] public bool ReadOnly { get { return base.ReadOnly; } set { base.ReadOnly = value; } } [Browsable(false)] public char PasswordChar { get { return base.PasswordChar; } set { base.PasswordChar = value; } } [Browsable(false)] public Size MaximumSize { get { return base.MaximumSize; } set { base.MaximumSize = value; } } [Browsable(false)] public Padding Margin { get { return base.Margin; } set { base.Margin = value; } } [Browsable(false)] public Point Location { get { return base.Location; } set { base.Location = value; } } [Browsable(false)] public ImeMode ImeModeBase { get { return base.ImeModeBase; } set { base.ImeModeBase = value; } } [Browsable(false)] public string[] Lines { get { return base.Lines; } set { base.Lines = value; } } [Browsable(false)] public bool HideSelection { get { return base.HideSelection; } set { base.HideSelection = value; } } [Browsable(false)] public Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } } [Browsable(false)] public Font Font { get { return base.Font; } set { base.Font = value; } } [Browsable(false)] public bool Enabled { get { return base.Enabled; } set { base.Enabled = value; } } [Browsable(false)] public DockStyle Dock { get { return base.Dock; } set { base.Dock = value; } } [Browsable(false)] public Cursor Cursor { get { return base.Cursor; } set { base.Cursor = value; } } [Browsable(false)] public ContextMenuStrip ContextMenuStrip { get { return base.ContextMenuStrip; } set { base.ContextMenuStrip = value; } } [Browsable(false)] public CharacterCasing CharacterCasing { get { return base.CharacterCasing; } set { base.CharacterCasing = value; } } [Browsable(false)] public bool CausesValidation { get { return base.CausesValidation; } set { base.CausesValidation = value; } } [Browsable(false)] public BorderStyle BorderStyle { get { return base.BorderStyle; } set { base.BorderStyle = value; } } [Browsable(false)] public Color BackColor { get { return base.BackColor; } set { base.BackColor = value; } } [Browsable(false)] public AutoCompleteSource AutoCompleteSource { get { return base.AutoCompleteSource; } set { base.AutoCompleteSource = value; } } [Browsable(false)] public AutoCompleteMode AutoCompleteMode { get { return base.AutoCompleteMode; } set { base.AutoCompleteMode = value; } } [Browsable(false)] public AutoCompleteStringCollection AutoCompleteCustomSource { get { return base.AutoCompleteCustomSource; } set { base.AutoCompleteCustomSource = value; } } [Browsable(false)] public AnchorStyles Anchor { get { return base.Anchor; } set { base.Anchor = value; } } [Browsable(false)] public bool AllowDrop { get { return base.AllowDrop; } set { base.AllowDrop = value; } } [Browsable(false)] public AccessibleRole AccessibleRole { get { return base.AccessibleRole; } set { base.AccessibleRole = value; } } [Browsable(false)] public string AccessibleName { get { return base.AccessibleName; } set { base.AccessibleName = value; } } [Browsable(false)] public string AccessibleDescription { get { return base.AccessibleDescription; } set { base.AccessibleDescription = value; } } [Browsable(false)] public string AccessibleDefaultActionDescription { get { return base.AccessibleDefaultActionDescription; } set { base.AccessibleDefaultActionDescription = value; } } [Browsable(false)] public bool AcceptsReturn { get { return base.AcceptsReturn; } set { base.AcceptsReturn = value; } } [Browsable(false)] public bool AcceptsTab { get { return base.AcceptsTab; } set { base.AcceptsTab = value; } } [Browsable(false)] public override string Text { get {return base.Text;}set{base.Text = value;} } [Browsable(false)] public override bool Multiline { get { return base.Multiline; } set { base.Multiline = value; } }