C#: How to change the color of a disabled textbox?
-
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
senthil
Please don't repost a question just to push it back to the top of the forums. This isn't good.
Deja View - the feeling that you've seen this post before.
-
Please don't repost a question just to push it back to the top of the forums. This isn't good.
Deja View - the feeling that you've seen this post before.
-
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
senthil
Probably the easiest way to do this is for you to derive your own control from the textbox and handle the different background colour in there.
Deja View - the feeling that you've seen this post before.
-
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
senthil
Not sure if this is an option for your particular situation or not. When I need behavior like this I set the textbox to readonly instead of disabled. That way I can modify the backcolor. txtBox.ReadOnly = true; txtBox.BackColor = System.Drawing.Color.White; Hope this helps.
-
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
senthil
-
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
senthil
I thought you could set a textbox to
ReadOnly
andEnabled
.ReadOnly
would leave theBackColor
to white, whileEnabled
would set it gray. you can always set theBackColor
to virtually anyColor
you want after you've set itReadOnly
orEnabled
Hope this helps.V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview Archive -
I thought you could set a textbox to
ReadOnly
andEnabled
.ReadOnly
would leave theBackColor
to white, whileEnabled
would set it gray. you can always set theBackColor
to virtually anyColor
you want after you've set itReadOnly
orEnabled
Hope this helps.V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview ArchiveIIRC read only allows you to select text, disabled does not.
Otherwise [Microsoft is] toast in the long term no matter how much money they've got. They would be already if the Linux community didn't have it's head so firmly up it's own command line buffer that it looks like taking 15 years to find the desktop. -- Matthew Faithfull
-
sorry i actually never meant to repost to make it visible at top! it was my net problem. since when processing slowed i pressed the post button twice. kssk
senthil
kssknov wrote:
it was my net problem. since when processing slowed i pressed the post button twice.
Hey, it happens :)
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon