Skip to content

Can't set ComboBox buttons width with ControlsHelper.ButtonWidth #2352

@iSlaffko

Description

@iSlaffko

If you set a height of a ComboBox to a larger number than a default one, you may see, that buttons (two with editable ComboBox) take a lot of space comared to other similar controls. Here is an example of ridiculously tall ComboBox in demonstrational purpose (note: ClearTextButton is pressed):

image

If I understood it right, buttons' shape is set to be square in ComboBox XAML:

<ColumnDefinition Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}, Path=ActualHeight, Mode=OneWay}" />

I'd like to have the ability to set buttons' width using Controls:ControlsHelper.ButtonWidth="22" as it is allowed in TextBox

<ColumnDefinition x:Name="ButtonColumn" Width="Auto" />
...
<Button x:Name="PART_ClearText"
    Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.ButtonWidth), Mode=OneWay}"
...

What I'd like to have in a case of such a huge control is:

image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions