DiverDan
Well-known member
With a custom combobox control, I am having problems keeping the backcolor white when the control is disabled. My code is:
Protected Overrides Sub OnEnabledChanged(ByVal e As System.EventArgs)
If Me.Enabled Then
Me.ForeColor = EnabledColor
Me.IntegralHeight = True
Else
Me.ForeColor = DisabledColor
Me.IntegralHeight = False
End If
Me.BackColor = MyBase.BackColor
End Sub
This works fine when the control is enabled but the backcolor becomes gray when disabled. How can I keep the backcolor the same for enabled and disabled?
An alternitive would be to prevent the combobox from dropping down.
Thanks
Dan
Protected Overrides Sub OnEnabledChanged(ByVal e As System.EventArgs)
If Me.Enabled Then
Me.ForeColor = EnabledColor
Me.IntegralHeight = True
Else
Me.ForeColor = DisabledColor
Me.IntegralHeight = False
End If
Me.BackColor = MyBase.BackColor
End Sub
This works fine when the control is enabled but the backcolor becomes gray when disabled. How can I keep the backcolor the same for enabled and disabled?
An alternitive would be to prevent the combobox from dropping down.
Thanks
Dan
Last edited by a moderator: