custom TextBox

  • Thread starter Thread starter cronusf
  • Start date Start date
C

cronusf

Hello all, I wanted some advice on the easiest way to go about the
following:

I have some TextBoxes that are enabled/disabled at various times in
the program. When they are disabled, the default is a gray background
with dark gray text. Is it possible to customize the text color when
the TextBox is disabled. For example, make it red?
 
(e-mail address removed) escreveu:
Hello all, I wanted some advice on the easiest way to go about the
following:

I have some TextBoxes that are enabled/disabled at various times in
the program. When they are disabled, the default is a gray background
with dark gray text. Is it possible to customize the text color when
the TextBox is disabled. For example, make it red?
Yes, you make a new object and inherits a TextBox. Make the Overload
Property Enabled.

Shuch as:

Public Class PTextBox
Inherits TextBox


Public Overloads Property Enabled() As Boolean
Get
Return MyBase.Enabled
MyBase.BackColor = Color.Red
End Get
Set(ByVal value As Boolean)
MyBase.Enabled = value
MyBase.BackColor = Color.Red
End Set
End Property

End Class
 
Back
Top