473,222 Members | 1,607 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,222 software developers and data experts.

How to stop disabled text boxes being greyed out

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
6 12100
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: JLM | last post by:
I have a form which I want users to "view only" certain fields. I don't want a tab stop on those fields, I don't want focus on those fields; nothing, just view only. When scrolling through the...
0
by: Pavs | last post by:
I have inherited a ms access database that i am meant to alter and make some changes to. The database was original i believe created in Access 2000 while now i am using Access 2002 and my OS is...
6
by: MLH | last post by:
You know how the text in the attached label sort of 'greys out' when you click something that sets MyTextbox.Enabled = False? I would like to make a label's text look like that? How do I do it?...
5
by: Robert Phillips | last post by:
I have a Panel control containing a few TextBox controls. The Panel is originally enabled, I enter data into the TextBox controls. When I submit, the Panel is disabled during the PostBack and the...
0
by: uthooker | last post by:
I have an Access form with some combo boxes in the Form Header that are enabled/disabled using conditional formatting based on the setting in a checkbox also in the Header (Combo box = Enabled by...
0
by: Swoosh | last post by:
Hi All, I am using ASP.Net Webcontrol to emit some HTML. The control is either a HyperLink or LinkButton. When I disable the control (by setting the controlls Enabled property) the following...
8
by: rahulnag22 | last post by:
I have created a button widget with a button click binding. The button initially has a state=disabled. I can see the greyed out version of the button in the GUI. But If I click on the button it...
2
by: damonjulian | last post by:
hi ,i created 3 buttons such that if button1 is clicked it will disable button2 ,and clicking button3 will restore state of button2 to normal, to my dismay i find that button2 still responds to...
6
by: Peter | last post by:
ASP.NET 2.0 Visual Studio 2008 I have the following code and when the textbox displays and I press Enter while in the text box I get AutoPostBack, how do I stop AutoPostBack? TextBox txt =...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.