Live Chat Icon For mobile
Live Chat Icon

At designtime, how can I hide a base class property in my derived control from the user

Platform: WinForms| Category: UI

Set the Browsable attribute on the new property that hides the existing one. Here is a code snippet that hides the WordWrap property in the derived TextBox.

public class MyTextBox : TextBox
	public new bool WordWrap
		get{ return false;} //always false

Public Class MyTextBox
	Inherits TextBox
	Public Shadows Property WordWrap() As Boolean
			Return False ’always false
		End Get
		Set ’empty
		End Set
	End Property
End Class ’MyTextBox 

Share with