![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | WPF combobox background The entire UI of my new application mimics the UI of Microsoft Expression Blend. I'm trying to get the background of the combobox to be the very dark grey, but can't make it happen. How can I change the background of a combobox, either IsEditable = true or false. Thanks |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: WPF combobox background It appears that the background of the collapsed part of the combo box is easily set using the Background attribute. I assume you're referring to the popup part of the combo box. I haven't experimented with it yet, but I know that the ComboBox control uses the PART_* architecture for identifying the popup element that gets brought up when you expand the ComboBox. It looks for a part called "PART_Popup". That is a <Popup> element. So what does that mean for you? If you were to create your own control template for the ComboBox, you would want to make sure you have a <Popup> element in your template called PART_Popup. That would have a background color set to be the same as the background color for the combo box itself. I'm not sure how you would define PART_Popup itself, although it's possible you could just define the Popup with nothing inside it and the control would do the work of binding it to the items in the combo box. Like I said, I haven't tried any of that. But it might get you started in the right direction. David Cater "Michael Jackson" <michaeldjackson@suddenlink.net> wrote in message news:466a2676$0$4303$bbae4d71@news.suddenlink.net... > The entire UI of my new application mimics the UI of Microsoft Expression > Blend. > I'm trying to get the background of the combobox to be the very dark grey, > but can't make it happen. > > How can I change the background of a combobox, either IsEditable = true or > false. > > Thanks > |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: WPF combobox background Scratch that. I was doing some experiments myself, and it's actually much easier than that. You don't have to completely override the control template, which is the direction my first response was going. All you have to change is the ItemsPanel, which controls how the items in the ComboBox are displayed on popup: <ComboBox Background="DarkGray" Foreground="White"> <ComboBox.ItemsSource> <coll:ArrayList> <sys:String>A</sys:String> <sys:String>B</sys:String> <sys:String>C</sys:String> </coll:ArrayList> </ComboBox.ItemsSource> <ComboBox.ItemsPanel> <ItemsPanelTemplate> <StackPanel Background="DarkGray"/> </ItemsPanelTemplate> </ComboBox.ItemsPanel> </ComboBox> David Cater "David Cater" <xiard@mindspring.com> wrote in message news:uAi%23lBDrHHA.4100@TK2MSFTNGP06.phx.gbl... > It appears that the background of the collapsed part of the combo box is > easily set using the Background attribute. I assume you're referring to > the popup part of the combo box. I haven't experimented with it yet, but > I know that the ComboBox control uses the PART_* architecture for > identifying the popup element that gets brought up when you expand the > ComboBox. It looks for a part called "PART_Popup". That is a <Popup> > element. > > So what does that mean for you? If you were to create your own control > template for the ComboBox, you would want to make sure you have a <Popup> > element in your template called PART_Popup. That would have a background > color set to be the same as the background color for the combo box itself. > I'm not sure how you would define PART_Popup itself, although it's > possible you could just define the Popup with nothing inside it and the > control would do the work of binding it to the items in the combo box. > > Like I said, I haven't tried any of that. But it might get you started in > the right direction. > > David Cater > > "Michael Jackson" <michaeldjackson@suddenlink.net> wrote in message > news:466a2676$0$4303$bbae4d71@news.suddenlink.net... >> The entire UI of my new application mimics the UI of Microsoft Expression >> Blend. >> I'm trying to get the background of the combobox to be the very dark >> grey, but can't make it happen. >> >> How can I change the background of a combobox, either IsEditable = true >> or false. >> >> Thanks >> > |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Custom Combobox in WPF | askaile | Avalon | 2 | 09-24-2007 02:47 AM |
| ComboBox Problem | Bahadýr ARSLAN | Avalon | 6 | 08-26-2007 04:17 PM |
| ComboBox Problem | Bahadýr ARSLAN | Avalon | 0 | 08-20-2007 01:47 AM |
| ComboBox on black background | John Lorenzen | Avalon | 2 | 11-02-2006 04:05 PM |
| combobox- transperant | crish | Avalon | 0 | 03-08-2006 06:11 AM |