Home > WPF > Styling ComboBox- part 1

Styling ComboBox- part 1

February 28, 2008 lee Leave a comment Go to comments

if we want to change the text that is displayed when user selects an item in the combobox, we have to change the ContentTemplate of the ContentPresenter in the Combobox Template

cb1.jpg

Attached is a sample(change .doc to .zip), which allows you to specify the template to be applied in the Tag property

comboboxsample2.doc

(update: added a thumb to the panel, which lets you resize the panel)

comboboxsample21.doc

Categories: WPF Tags: ,
  1. Sven
    March 1, 2008 at 2:43 pm | #1

    Awesome ! I always thought this should be possible but never got around to trying it. Do you think there’s a way to make the drop down panel resizable and make the items in it rearrange themselves accordingly ?

  2. lee
    March 1, 2008 at 8:52 pm | #2

    I will try to change it and update the sample

  3. Sven
    March 3, 2008 at 7:20 am | #3

    Thanks so much. You’ve just saved me a lot of research time.

  1. No trackbacks yet.