AVEbrahimi
AVEbrahimi

Reputation: 19134

WPF ComboBox with custom dropdown width

How can I extend width of dropdown of a combo, like Run dialog:

enter image description here

Upvotes: 6

Views: 2738

Answers (1)

ASh
ASh

Reputation: 35646

Popup is a part of ComboBox template ("PART_Popup"). Add a Style for Popup to combobox Resources and set appropriate width there.

<ComboBox>
    <ComboBox.Resources>
        <Style TargetType="Popup">
            <Setter Property="Width" Value="1000"/>
        </Style>
    </ComboBox.Resources>
</ComboBox>

note also that there is a binding for Popup.MinWidth in template so you can't make it too small.

Upvotes: 8

Related Questions