DeniseGoodheart
asked on
How to Make an Entire Combo/Drop Down List Box BackColor=Yellow
Good Day:
I am using VB.NET 2005. I would like to have my combo/drop down list box control backcolor to be yellow. The following code only outlines the combo/drop down list box to yellow and shows the backcolor as the system default color blue:
cboTaxable.BackColor = System.Drawing.Color.FromN ame(yellow)
Any Suggestions?
Thank You,
Denise
I am using VB.NET 2005. I would like to have my combo/drop down list box control backcolor to be yellow. The following code only outlines the combo/drop down list box to yellow and shows the backcolor as the system default color blue:
cboTaxable.BackColor = System.Drawing.Color.FromN
Any Suggestions?
Thank You,
Denise
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thats just because you have selected the item. tab out of the item and you should see yellow
Is this a windows or a web app?
ASKER
Hi All,
Thanks for the suggestions. This is a WindowsForms application. I left out details for simplicity. Here are the rest of the details. It does not work when I use the Enter Event as follows:
Private Sub cboTaxable_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboTaxable.Enter
cboTaxable.BackColor = System.Drawing.Color.FromN ame("yello w")
End Sub
Thank You,
Denise
Thanks for the suggestions. This is a WindowsForms application. I left out details for simplicity. Here are the rest of the details. It does not work when I use the Enter Event as follows:
Private Sub cboTaxable_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboTaxable.Enter
cboTaxable.BackColor = System.Drawing.Color.FromN
End Sub
Thank You,
Denise
Can you try this?
cboTaxable.BackColor = System.Drawing.Color.Yello w
cboTaxable.BackColor = System.Drawing.Color.Yello
I did this on a test form and it works when I enter the combobox. colour changes to yellow as expected. So I suspect it might have something to do with your windows colour scheme blocking things.
Private Sub ComboBox1_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.Enter
Me.ComboBox1.BackColor = Color.Yellow
End Sub
Private Sub ComboBox1_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.Enter
Me.ComboBox1.BackColor = Color.Yellow
End Sub
ASKER
Hi All,
The backcolor only works when the DropDownStyle=Simple or DropDown. When I have it set to DropDownList it does not work. I need to have it set at DropDownList to prevent users from typing random entries.
Any More Suggestions?
Thank You,
Denise
The backcolor only works when the DropDownStyle=Simple or DropDown. When I have it set to DropDownList it does not work. I need to have it set at DropDownList to prevent users from typing random entries.
Any More Suggestions?
Thank You,
Denise
It wouldnt make a difference if is a dropdown or a dropdownlist you should still be able to look at the background color as yellow.
I tried it here and it shows yellow for both types
I tried it here and it shows yellow for both types
OMG...
I just tested this with Dropdown style=DropDownList... It works fine.
However... As long as the field retains focus the background will be Blue! Click elsewhere and you will note it reverts to yellow (unless of course on the Leave event you set it back to white)
Ray
I just tested this with Dropdown style=DropDownList... It works fine.
However... As long as the field retains focus the background will be Blue! Click elsewhere and you will note it reverts to yellow (unless of course on the Leave event you set it back to white)
Ray
yeah like ray says its possible. check my first comment :)
ASKER
surajguptha:
Are you using VS.NET 2005?
Are you using VS.NET 2005?
Yes
ASKER
Hi All,
I apologize for giving you all bits and pieces, but I was trying to simplify the question. Yes, when the combo box is set to DropDownList; the backcolor=yellow when it LOSES the FOCUS, but the requirement is the following:
The control that has the focus shall have a backcolor=yellow
When the control loses the focus; it shall have a backcolor=white
Yes, my combo box backcolor=yellow when it loses focus and it is set to DropDownStyle=DropDownList ; but this does not meet the requirment.
Any More Suggestions?
Thanks,
Denise
I apologize for giving you all bits and pieces, but I was trying to simplify the question. Yes, when the combo box is set to DropDownList; the backcolor=yellow when it LOSES the FOCUS, but the requirement is the following:
The control that has the focus shall have a backcolor=yellow
When the control loses the focus; it shall have a backcolor=white
Yes, my combo box backcolor=yellow when it loses focus and it is set to DropDownStyle=DropDownList
Any More Suggestions?
Thanks,
Denise
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
surajguptha:
Well the person posted a question for the link you suggested, but no one posted a solution, so it is not going to help me.
Thanks
Well the person posted a question for the link you suggested, but no one posted a solution, so it is not going to help me.
Thanks
Hi Denise,
I just read the link posted by surajguptha. There is indeed a fairly complex response that I am sure will do what you need. However if you need clarification you might email the woman who gave the answer.
Check it again...
Cheers
Ray
I just read the link posted by surajguptha. There is indeed a fairly complex response that I am sure will do what you need. However if you need clarification you might email the woman who gave the answer.
Check it again...
Cheers
Ray
ASKER
Hi All:
Thanks for trying to help, but unfortunately the suggetions did not work, and the link provided required too much time for such a simple requirement. Perhaps my setting are different or I did not explain myself clearly, but I appreicate all your efforts.
Cheers,
Denise
Thanks for trying to help, but unfortunately the suggetions did not work, and the link provided required too much time for such a simple requirement. Perhaps my setting are different or I did not explain myself clearly, but I appreicate all your efforts.
Cheers,
Denise