473,471 Members | 4,625 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Disabled control background color property

RSH

This might be a dumb question but I have searched everywhere...I have a form
which uses a custom background color. I have set the control's backgrounds
to transparent, which works great. But when i disable the controls, they
all have the standard beige Windows background, is there a way to set the
disabled background color too??

Thanks,
Ron
Jan 10 '06 #1
4 3823
On Tue, 10 Jan 2006 14:15:43 -0500, "RSH" <wa*************@yahoo.com>
wrote:

-->
--> This might be a dumb question but I have searched everywhere...I
have a form
--> which uses a custom background color. I have set the control's
backgrounds
--> to transparent, which works great. But when i disable the
controls, they
--> all have the standard beige Windows background, is there a way to
set the
--> disabled background color too??
-->
--> Thanks,
--> Ron
-->
Ron,

Can you just override the OnPaintBackground methods of the controls
you're wanting to be transparent?
Jan 10 '06 #2
RSH

Okay I understand how to override the OnPaintBackground method, but how do I
do it for specific controls?

I tried this:

protected override void OnPaintBackground(PaintEventArgs Pe)

{

comboBox1.BackColor = Color.DarkBlue;

}

But it simply turned the control blue when it was enabled...when I disabled
the control it went back to the normal windows color. Not to mention that
all the other controls and the form itself were transparent (Cool but not
the effect I was after.

Thanks,

Ron



"Michael H" <gf*****@gmail.com> wrote in message
news:7o********************************@4ax.com...
On Tue, 10 Jan 2006 14:15:43 -0500, "RSH" <wa*************@yahoo.com>
wrote:

-->
--> This might be a dumb question but I have searched everywhere...I
have a form
--> which uses a custom background color. I have set the control's
backgrounds
--> to transparent, which works great. But when i disable the
controls, they
--> all have the standard beige Windows background, is there a way to
set the
--> disabled background color too??
-->
--> Thanks,
--> Ron
-->
Ron,

Can you just override the OnPaintBackground methods of the controls
you're wanting to be transparent?

Jan 11 '06 #3
Ron,

Have you tried to create a custom Control that inherits from the
Control you want to add onto your Form? It's in this custom Control
where you would override the OnPaintBackground, not on the Form
itself.

Michael
Jan 12 '06 #4
RSH
What would the code look like to do this?

I have tried doing this but it doesn't matter when I click on a button that
sets the control's Enable property to false it still sets the color to the
normal Windows background color which looks really bad on a a gradated grey
background.

Thanks,
Ron
"Michael H" <gf*****@gmail.com> wrote in message
news:ug********************************@4ax.com...
Ron,

Have you tried to create a custom Control that inherits from the
Control you want to add onto your Form? It's in this custom Control
where you would override the OnPaintBackground, not on the Form
itself.

Michael

Jan 13 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Skip Borland | last post by:
Has anyone tried to control the color changes that occur when a .net control (in this case specifically, a combo box) is disabled? We are trying to limit input, yet not have the control go gray on...
5
by: Mark Hannon | last post by:
I have been researching the "disabled" property for form data and wanted to know: - Does the disabled property supress the form item from being submitted? - Can the disabled property be applied...
3
by: Kelly Domalik | last post by:
I would like to override the "disabled" property of a hidden field. When disabled is set to "true", it would call a function to disable 2 other text fields on the form. When disabled is set to...
3
by: Steve Le Monnier | last post by:
When you make a textbox control disabled ( txtText1.Enabled = false; ) You're left with grey text on a greyer background, which is not ideal. The Read-Only property is no use to me as I need to...
2
by: James Ramaley | last post by:
Setting the ReadOnly property of my controls changes the background color. The same happens when I set Enabled = False. Where does .NET get the new background color from? Is it configurable? ...
0
by: sunny076 | last post by:
Hi, I am having difficulties creating a derived class for DisabledDataGridViewTextBoxColumn and cell when the VisualStyle is not supported. Basically I am down to either using ControlPaint or...
7
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...
2
by: =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?= | last post by:
HI there. I use IE7. We have a user with bad eyesight. he cannot read the font when IE makes an input disabled (the light grey color font). I am able to change the background to a different color...
6
by: =?Utf-8?B?Sm9obiBBdXN0aW4=?= | last post by:
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...
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
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...
0
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.