473,419 Members | 1,633 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,419 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 12148
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.