Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF ComboBoxItem Style

$
0
0

Hi All,

I have several comboboxes in my WPF Window and I have applied the styles on them using below code: 

<Style TargetType="{x:Type ComboBoxItem}"><Setter Property="Template"><Setter.Value><ControlTemplate TargetType="{x:Type ComboBoxItem}"><Border x:Name="Border" Background="{TemplateBinding Background}"><ContentPresenter/></Border><ControlTemplate.Triggers><Trigger Property="IsMouseOver" Value="true"><Setter Property="Background" TargetName="Border"><Setter.Value><SolidColorBrush Color="Blue"></SolidColorBrush></Setter.Value></Setter></Trigger></ControlTemplate.Triggers></ControlTemplate></Setter.Value></Setter></Style>

I have to increase the height of every ComboBoxItem to "20" and vertical alignment of text in every ComboBoxItem should be centered. Please advise how can I achieve this with above Style. 

Regrads,

Pratham


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>