I'm trying to create a inherited control. I made a boolean public property for this control titled "Flickering" to enable/disable the flickering effects on the control.
Then what I want is to "turn on" the next overridable property only when the "Flickering" property is enabled, but I don't have idea of how to do this:
Protected Overrides ReadOnly Property CreateParams() As CreateParams
If Disable_Flickering = True Then
Get
Dim cp As CreateParams = MyBase.CreateParams
cp.ExStyle = cp.ExStyle Or &H2000000
Return cp
End Get
End If
End Property
The code obviously does not work but also I think I'm not thinking in the correct logic to do this.
How I can do it?
ANSWER:
''' <summary>
''' Enable/Disable any flickering effect on the panel.
''' </summary>
Protected Overrides ReadOnly Property CreateParams() As CreateParams
Get
If _Diable_Flickering Then
Dim cp As CreateParams = MyBase.CreateParams
cp.ExStyle = cp.ExStyle Or &H2000000
Return cp
Else
Return MyBase.CreateParams
End If
End Get
End Property