custom TextBox

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?
 
J

Joao Marcelo

(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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top