473,553 Members | 3,081 Online
Bytes | Software Development & Data Engineering Community
+ 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 3843
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 OnPaintBackgrou nd methods of the controls
you're wanting to be transparent?
Jan 10 '06 #2
RSH

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

I tried this:

protected override void OnPaintBackgrou nd(PaintEventAr gs Pe)

{

comboBox1.BackC olor = 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.c om...
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 OnPaintBackgrou nd 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 OnPaintBackgrou nd, 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.c om...
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 OnPaintBackgrou nd, 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
1754
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 gray when disabled (or at least be able to control the behavior). Any thoughts on this would be appreciated....Skip
5
2460
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 when the submit button is pressed? I am designing a PayPal order page that will have 4 items, each with a 3-character text box where the customer...
3
5129
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 "false", it would enable those 2 text fields. You should also be able to get the value of it as if it were a property: ...
3
33902
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 prevent complete access, so i've been trying to change the visual display of a control once I have disabled it and discovered the following. You...
2
1890
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? thanks
0
2485
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 Graphics to achieve this. But with Graphics, I am not sure how I can make them diabled. Below are my codes:
7
11776
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 style look of my form. How can i change the colour that control assumed when it's disabled? Thanks! Gary-
2
4458
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 to white to try and increase a contrast, but he still cant read it. Does anyone know a workaround to override this font behaviour when an input is...
6
12183
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 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...
0
7492
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7772
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8007
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7526
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7852
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5133
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3525
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1106
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
808
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.