By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,827 Members | 2,195 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,827 IT Pros & Developers. It's quick & easy.

How to stop disabled text boxes being greyed out

P: n/a
I have an app that displays about 20 items of data in text boxes. Very
occasionally I need to allow these to be used for data entry, but the bulk of
the time they are solely for information. They all sit in a GroupBox that is
normally disabled, but is enabled when data can be edited. The users complain
that when the GroupBox.Enabled=False, the greyed out text boxes are hard to
read. I would like to find a way to disable the GroupBox whilst leaving the
text boxes clearly visible.
--
John Austin

--
John Austin
Nov 27 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
You might try setting each textbox's ReadOnly property to True, instead of
disabling them. Then when you wanted to enable (make them non ReadOnly), you
could:

For Each ctrl As Control In GroupBox1.Controls
If TypeOf ctrl Is TextBox Then
DirectCast(ctrl, TextBox).ReadOnly = False
End If
Next

--
Terry
"John Austin" wrote:
I have an app that displays about 20 items of data in text boxes. Very
occasionally I need to allow these to be used for data entry, but the bulk of
the time they are solely for information. They all sit in a GroupBox that is
normally disabled, but is enabled when data can be edited. The users complain
that when the GroupBox.Enabled=False, the greyed out text boxes are hard to
read. I would like to find a way to disable the GroupBox whilst leaving the
text boxes clearly visible.
--
John Austin

--
John Austin
Nov 27 '07 #2

P: n/a
John
Although it is possible to use the Readonly property to lock the contents of
a Texbox. As a user I would expect a normal looking textbox to be editable
only to find that it is not. You may want to work with your uses to see how
they feel about this. Sometimes could be quite frustrating unless you show
them some visual cue as to when it is disabled and when enabled for editing.

Regards,

Trevor Benedict
MCSD

"John Austin" <Jo*********@nospam.nospamwrote in message
news:4D**********************************@microsof t.com...
>I have an app that displays about 20 items of data in text boxes. Very
occasionally I need to allow these to be used for data entry, but the bulk
of
the time they are solely for information. They all sit in a GroupBox that
is
normally disabled, but is enabled when data can be edited. The users
complain
that when the GroupBox.Enabled=False, the greyed out text boxes are hard
to
read. I would like to find a way to disable the GroupBox whilst leaving
the
text boxes clearly visible.
--
John Austin

--
John Austin

Nov 27 '07 #3

P: n/a
Yes, I do a similar thing to set the text boxes BackColor in
GroupBox1.EnabledChanged so that it is obvious to the user when they can and
can't type in the boxes. The thing I don't like about setting ReadOnly is
that if the user can get the cursor in the box, they then phone up and ask
why they can't type anything. I really want to make the Text Boxes look like
labels when they can't type in them, and like text boxes when they can.

Thanks for the suggestion.
--
John Austin
"Terry" wrote:
You might try setting each textbox's ReadOnly property to True, instead of
disabling them. Then when you wanted to enable (make them non ReadOnly), you
could:

For Each ctrl As Control In GroupBox1.Controls
If TypeOf ctrl Is TextBox Then
DirectCast(ctrl, TextBox).ReadOnly = False
End If
Next

--
Terry
"John Austin" wrote:
I have an app that displays about 20 items of data in text boxes. Very
occasionally I need to allow these to be used for data entry, but the bulk of
the time they are solely for information. They all sit in a GroupBox that is
normally disabled, but is enabled when data can be edited. The users complain
that when the GroupBox.Enabled=False, the greyed out text boxes are hard to
read. I would like to find a way to disable the GroupBox whilst leaving the
text boxes clearly visible.
--
John Austin

--
John Austin
Nov 27 '07 #4

P: n/a
Our postings have crossed - I agree!
--
John Austin
"Trevor Benedict" wrote:
John
Although it is possible to use the Readonly property to lock the contents of
a Texbox. As a user I would expect a normal looking textbox to be editable
only to find that it is not. You may want to work with your uses to see how
they feel about this. Sometimes could be quite frustrating unless you show
them some visual cue as to when it is disabled and when enabled for editing.

Regards,

Trevor Benedict
MCSD

"John Austin" <Jo*********@nospam.nospamwrote in message
news:4D**********************************@microsof t.com...
I have an app that displays about 20 items of data in text boxes. Very
occasionally I need to allow these to be used for data entry, but the bulk
of
the time they are solely for information. They all sit in a GroupBox that
is
normally disabled, but is enabled when data can be edited. The users
complain
that when the GroupBox.Enabled=False, the greyed out text boxes are hard
to
read. I would like to find a way to disable the GroupBox whilst leaving
the
text boxes clearly visible.
--
John Austin

--
John Austin


Nov 27 '07 #5

P: n/a
I agree, but a ReadOnly textbox is not normal looking. It has a 'control'
color background. Also, if you clue your users by changing the background
when they enter it, you can skip that for a readonly.
--
Terry
"Trevor Benedict" wrote:
John
Although it is possible to use the Readonly property to lock the contents of
a Texbox. As a user I would expect a normal looking textbox to be editable
only to find that it is not. You may want to work with your uses to see how
they feel about this. Sometimes could be quite frustrating unless you show
them some visual cue as to when it is disabled and when enabled for editing.

Regards,

Trevor Benedict
MCSD

"John Austin" <Jo*********@nospam.nospamwrote in message
news:4D**********************************@microsof t.com...
I have an app that displays about 20 items of data in text boxes. Very
occasionally I need to allow these to be used for data entry, but the bulk
of
the time they are solely for information. They all sit in a GroupBox that
is
normally disabled, but is enabled when data can be edited. The users
complain
that when the GroupBox.Enabled=False, the greyed out text boxes are hard
to
read. I would like to find a way to disable the GroupBox whilst leaving
the
text boxes clearly visible.
--
John Austin

--
John Austin


Nov 27 '07 #6

P: n/a
The only real problem is that users complain that they have difficulty
reading greyed out text boxes.
The objective of 'greying out' is a visual cue to show the user that the
text box is disabled, not to prevent them reading it easily.
A better solution from Microsoft would be to treat Enabled=False the same
way as ReadOnly=True, if system colours are used, apply grey; If custom
colours are used leave it to the programmer.
--
John Austin
"Terry" wrote:
I agree, but a ReadOnly textbox is not normal looking. It has a 'control'
color background. Also, if you clue your users by changing the background
when they enter it, you can skip that for a readonly.
--
Terry
"Trevor Benedict" wrote:
John
Although it is possible to use the Readonly property to lock the contents of
a Texbox. As a user I would expect a normal looking textbox to be editable
only to find that it is not. You may want to work with your uses to see how
they feel about this. Sometimes could be quite frustrating unless you show
them some visual cue as to when it is disabled and when enabled for editing.

Regards,

Trevor Benedict
MCSD

"John Austin" <Jo*********@nospam.nospamwrote in message
news:4D**********************************@microsof t.com...
>I have an app that displays about 20 items of data in text boxes. Very
occasionally I need to allow these to be used for data entry, but the bulk
of
the time they are solely for information. They all sit in a GroupBox that
is
normally disabled, but is enabled when data can be edited. The users
complain
that when the GroupBox.Enabled=False, the greyed out text boxes are hard
to
read. I would like to find a way to disable the GroupBox whilst leaving
the
text boxes clearly visible.
--
John Austin
>
--
John Austin
Dec 4 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.