473,396 Members | 1,891 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,396 software developers and data experts.

Combobox.backcolor dosn't work

Hi all.

I am setting some color on my combo's:
this.combobox1.BackColor = Colors.White;

This only works when the combobox is enabled.

How can i add color to a disabled combobox?

Lars
Jul 6 '06 #1
4 3261
cp
thats standard behaviour for disabled controls - you could derive your
own and override OnPaintBackground but personally i would stick to the
(ahem) convention.

cp

Lars E. Nes wrote:
Hi all.

I am setting some color on my combo's:
this.combobox1.BackColor = Colors.White;

This only works when the combobox is enabled.

How can i add color to a disabled combobox?

Lars
Jul 6 '06 #2

"Lars E. Nes" <La******@discussions.microsoft.comwrote in message
news:FB**********************************@microsof t.com...
Hi all.

I am setting some color on my combo's:
this.combobox1.BackColor = Colors.White;

This only works when the combobox is enabled.

How can i add color to a disabled combobox?

Lars
AFAIK, you cannot.
Jul 6 '06 #3
Disable the combobox yourself then using the Disable properties. The user
can choose the combobox but no effect when you change to certain color.

chanmm

"Lars E. Nes" <La******@discussions.microsoft.comwrote in message
news:FB**********************************@microsof t.com...
Hi all.

I am setting some color on my combo's:
this.combobox1.BackColor = Colors.White;

This only works when the combobox is enabled.

How can i add color to a disabled combobox?

Lars

Jul 6 '06 #4
Excellent.

Solved it by setting a bool Locked to true.
And then added an event when this combobox was entered.

Thanks.

"chanmm" wrote:
Disable the combobox yourself then using the Disable properties. The user
can choose the combobox but no effect when you change to certain color.

chanmm

"Lars E. Nes" <La******@discussions.microsoft.comwrote in message
news:FB**********************************@microsof t.com...
Hi all.

I am setting some color on my combo's:
this.combobox1.BackColor = Colors.White;

This only works when the combobox is enabled.

How can i add color to a disabled combobox?

Lars


Jul 7 '06 #5

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

Similar topics

0
by: Mohamed Osman | last post by:
If a bind a data table to a comboxbox as appose to merging the table into a dataset the selectedvalue property does not work consistently On loading of a form: A datatable is created from a...
5
by: Ray Alirezaei | last post by:
Hi all When I copy and paste a piece of code from a web page into IDE ,,it is well formatted and instead of "<" or ">" characters "&alt" shows up.why is that ? Thanks for your help in advance....
1
by: TT (Tom Tempelaere) | last post by:
Hi there, I made a custom drawn ComboBox. The DrawItem event handler is (explanation follows) <code> private void OnDrawItem ( object sender, System.Windows.Forms.DrawItemEventArgs e ) {
1
by: t perkins | last post by:
would there be a reason why i cannot set the backcolor on lables to be transparent. it is set to be transparent, but it does not work for some reason. any help would be greatly appreciated ...
4
by: Reza | last post by:
checkedListBox1.ClearSelected(),dosn't clear my selections in my checkedboxlist. How can I clear an specific item based on its value ,name or anything else? thanks for your response.
1
by: jobs | last post by:
I can't seem to get selectedrowstyle-backcolor to set the row background color unless I force the selected index in the code behind. When i select the ButtonField Run button it does set the...
3
by: Karsten_Markmann | last post by:
Hi I am building a large application where we use the combobox feature a lot. Its an office addin for office XP. I am using Visual studio 2003 VB. In outlook and excel it works perfect all the...
14
by: Jonas.Holmsten | last post by:
Hello I'm porting some C++ stuff to C and having problem to get it through gcc. Here is a condensed version of the problem: void foo(const int * const * const ptr) {} main()
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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...

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.