473,512 Members | 14,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

c#: How to change the Back color of the Disabled TextBox control

40 New Member
hi
I am using Textbox contrl which is disabled for some conditions.
I would like to make the Textboxes back color as white as it looks when it is enabled? Can u pls help how to change its back color?


Thank u
Dec 19 '07 #1
4 28908
debasisdas
8,127 Recognized Expert Expert
Once you enable the textbox its back color will automatically changed to default white.
Dec 19 '07 #2
ssknov
40 New Member
hi das
sorry my question was wrong,
though it was disabled it should be in white color?

now i did it thanku.

for others following code may help

this.txtUserName.BackColor = System.Drawing.SystemColors.ControlLightLight;

cheers
kssk
Dec 19 '07 #3
ilyaostr
1 New Member
Couldn't you just set it's ReadOnly property to true?
Sep 30 '08 #4
Plater
7,872 Recognized Expert Expert
If this is a windows application, just set the background color like normal and it works:
Expand|Select|Wrap|Line Numbers
  1. tbinput.Enabled = false;
  2. tbinput.BackColor = Color.Red;
  3.  
If it is a web application, changes it's style element's backgroundcolor
Oct 1 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
4470
by: Mantorok | last post by:
Hi all Is it possible to disable a Control in .Net but have the text colour always in black? I would rather use Enabled property rather than Readonly as it does everything I need it to in one...
5
6916
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...
3
4480
by: Marc Castrechini | last post by:
I have a page that changes an <ASP:Checkbox value based on a user entered value in a textboxm using client side Javascript. After my submit is fired the value for the chkMyCB.checked does not get...
1
2821
by: jboldrick | last post by:
I'm using Access 2003. I seem to have suddenly lost the ability to set the Back Style property of tab controls to "Transparent." Or rather, I can set the property value as "Transparent" but nothing...
3
1638
by: david | last post by:
I have written JavaScript and try to change the radio button property (disenable other radio buttons) once click on it. But it does not work. For example, I have radio buttons A, B, and C. A and B...
4
10393
by: Matrixreloadedth | last post by:
How to change disable color of Checkbox??? I have a checkbox with forecolor in red but when i disable by set Enable properties to false forecolor is changed to gray color but i don't want it. how...
2
1701
by: sonic | last post by:
I realize that if a field is disabled, its value will not be posted to server. i realize that .Enabled = false, produces disabled="disabled" markup i still don't see a good way to disable a...
4
8585
by: Bob | last post by:
Hi, Is it possible to change the forecolor of a disabled text control. I have a RichText Box that I don't want the user to edit but the Grey on Grey default is hard to read. Is there a way of...
7
11750
by: garyusenet | last post by:
I'm using krypton toolkit which has allowed me to make a cool looking form. However, when I set my textbox to disabled it is 'greyed' out. The grey colour isn't in keeping with the office 2007...
0
7254
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
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7432
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
7519
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5677
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5079
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
4743
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...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1585
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.