To change Font Size, Foreground or Font Family
1) Directly Assign Property to Content-presenter
- XAML
<ContentPresenter TextBlock.FontFamily="Tahoma"
TextBlock.FontWeight="Bold"
TextBlock.Foreground="Red"
VerticalAlignment="Center"
RecognizesAccessKey="True" />
2)Adding Setter To the Style-
<Trigger Property="IsSelected" Value="true">
<Setter Property="TextBlock.Foreground" TargetName="TabHeadetText" Value="white"/>
<Setter Property="TextBlock.Foreground" TargetName="TabHeadetText" Value="white"/>
<Setter Property="
</Trigger>
TextBlock.FontFamily
" TargetName="TabHeadetText" Value="Tahoma
"/></Trigger>
Hello,
ReplyDeleteI did this, and I got run time error: textblock doesn't have attached properity fontfamily ??!
Can you help me in this
Best regards
hi Waleed,
DeleteAbove code can be apply to "ContentPresenter" of Button or Tab button.
Please check out following example
WpfApplication1.zip
WpfApplication1Setter.zip
crap
ReplyDelete