I have a custom UserControl that contains just one TextBox.
When I set the control to Enabled = False, the TextBox is disabled but the control is not (control still fires the Enter event).
How do I ensure that the UserControl will not receive focus?
My Enabled Property Looks like this:
Private _Enabled As Boolean = True
Public Shadows Property Enabled As Boolean
Get
Return _Enabled
End Get
Set(value As Boolean)
_Enabled = value
txtTime.Enabled = value
End Set
End Property
To answer your immediate question, you need to pass the enabled property to the base object:
However… the correct way to do it is using the
OnEnabledChangedoverride:(As you tagged it C#, I assume you can convert back to VB.net yourself)