WPF: Setting toolbar button sizes using a Style

Posted by Allen Ho on Stack Overflow See other posts from Stack Overflow or by Allen Ho
Published on 2010-03-09T01:36:08Z Indexed on 2010/03/09 2:06 UTC
Read the original article Hit count: 491

Filed under:
|
|

I have buttons on a toolbar in WPF.

When I do the XAML:

<ToolBar.Resources>
   <Style TargetType="{x:Type Button}">
      <Setter Property="Width" Value="21"></Setter>
      <Setter Property="Height" Value="21"></Setter>
   </Style>
</ToolBar.Resources>

None of the buttons on the toolbar set their sizes accordingly.

I have to go to each button and manually set their widths and heights to the desired values.

Any idea why the Style on the toolbar does not work?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about toolbar