Combobox DropDownList Style with white background

c# combobox selected item background color
dropdownlist color
dropdownlist background color
powershell combobox color
.net dropdownlist color
.net combobox color
change dropdownlist color c#

I want to have an uneditable ComboBox but still show a white background colour, so it is effectively styled like the default ComboBox style (DropDown). The ComboBoxStyle.DropDownList only provides the standard "disabled" looking grey back colour. Simply setting BackColor = Color.White has no effect.



To make a ComboBox DropDownList look like a ComboBox DropDown:

  1. Add a ComboBox to the WinForm. Go to Properties Explorer. Select DropDownStyle > DropDownList. Then select FlatStyle > Flat.
  2. Add a Panel to the WinForm. Go to Properties Explorer. Select BorderStyle > FixedSingle.
  3. Drag ComboBox onto Panel. With ComboBox active, go to Properties Explorer > Dock > Fill.
  4. With ComboBox active, hold the ‘Shift’ key, select the Panel to make it active as well (order of selection is important).
  5. Go to the Layout Toolbar (View > ToolBars > Layout) and select ‘Make Same Size’.
  6. When you run your program, the DropDownList ComboBox should look like a DropDown ComboBox

how can set the background color of DropDownlist in c# ., The problem is, when I set the style to DropDown, (I have the Back Colour set to a light program there is sort of an outline of the background colour around the combo box, but the inside of the box is just white. I currently have combo boxes and their DropDown property is set to DropDownList, however,  The drop-down style is set to ' ComboBox.DropDown, which requires the user to click on the arrow to ' see the list. Private Sub InitializeComboBox () Me.ComboBox1 = New ComboBox Me.ComboBox1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable Me.ComboBox1.Location = New System.Drawing.Point

I played around with this for a while and didn't want to do anything too involved. Those ideas above probably work but all I did was change the flatStyle property from "standard" to "flat".

Although not perfect, it at least changes the background that grey/disabled look to white.

You can see the comparison here:

Heating Source #1 > DropdownList > flat (the final decision since dropdown was allowing users to enter bad data)

Heater Source #2 > Dropdown > Standard (the default which looks nice)

Housing Type > Dropdown > Flat

Heating Source #1 Vendor > DropdownList > Standard (the default which looks disabled grey)

Combo Box (style DropDown) Back Colour Property, Background is blue but text must be white or lightgray in order to have a contrast. Any help with this? Thx. Last edited by ovi_gm; Apr 25th, 2013  1 Answer 1. You can set FlatStyle property to Popup. This way the back color will use in both DropDown and DropDownList mode. If you don't like flat style or you need more customization on rendering of ComboBox, you can use an owner-drawn ComboBox.

You will have to create your own ComboBox with custom drawing or use a third-party control such as Infragistics UltraCombo

public class MyComboBox : ComboBox
        public MyComboBox()
            this.SetStyle(ControlStyles.UserPaint, true);

        protected override void OnPaint(PaintEventArgs e)
          // Repaint here

ComboBox with different color Items and DropDownList Style, In windows forms, ComboBox provides two different features in a single control, it means ComboBox works as both TextBox and ListBox. In ComboBox, only one  In ComboBox, only one item is displayed at a time and the rest of the items are present in the drop-down menu. You are allowed to set the background color of the ComboBox by using the BackColor Property .

Having struggled trying to get the control looking identical to the DropDown ComboBox style I had to settle with overriding the OnKeyPress event so that it restricted the user from been able to edit the control. As a side note I would also recommend overriding the appropriate event to prevent users pasting values into the ComboBox (how to disable copy, Paste and delete features on a textbox using C#).

protected override void OnKeyPress(KeyPressEventArgs e)
    e.Handled = true;

How to set the Background Color of the ComboBox in C , I set the style to csOwnerDrawFixed and usethe OnChange event combobox initially draws with a background color, it becomes white when the item is selected. ComboBox is drawing an item in its edit box instead of in the drop-​down list. I've tried setting the control's BackColor to white but there was no change. I want the behavior of DropDownList where the user can only pick from the options available and not write in a new option but the look of DropDown (a plain white background).

TComboBox, style: csDropdownList, background color, I need to have my drop down list control style=DropDownList. Any Suggestions? When the control lost the focus; it shall have a backcolor=white. Yes, my combo box backcolor=yellow when it lost focus and it is set to  Combo Box Styles. 05/31/2018; 2 minutes to read; In this article. To create a combo box using the CreateWindow or CreateWindowEx function, specify the COMBOBOX class, appropriate window style constants, and a combination of the following combo box styles.

How to Change the Drop Down List Control Back Color Using Code , Telerik Forums / UI for WinForms Forum / DropDownList / Some of these need to have a different background color to indicate that they are required. we can get a fully colored background..but if there is a way to fully  vbCity is a community of VB and .NET developers joined together with a common goal: to learn, teach, and have fun programming. Developers from all over the world come together to share knowledge, source code, and tutorials for free to help their fellow programmers - Professional Developers, Hobbyists and Students alike.

How to change dropdown backcolor? in UI for WinForms , I was able to style the initial value and the selected value, but not the drop down list, which currently has a white background and light gray text that is hard to  When using IsEditable=False then to change the background means getting in the ToggleButton style which means overriding the entire ComboBox style. Reason for my vote of 1 Bad gusbrasil 10-Aug-10 6:06

  • try the IsEditable and IsReadOnly properties…
  • That's for WPF not WinForms, thanks tho.
  • Tried in Visual Studo 2017 and it worked very well.
  • Why did you need "Make Same Size" when "Dock = Fill" should have done the same thing?