Change a Control's Font Weight on Mouse Over : Font « Windows Presentation Foundation « VB.Net Tutorial






<Window x:Class="WpfApplication1.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="" Height="120" Width="240">

    <Window.Resources>
        <Style TargetType="{x:Type Button}">
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="FontWeight" Value="Bold" />
                </Trigger>
            </Style.Triggers>
        </Style>

    </Window.Resources>

    <StackPanel Margin="8">
        <Button Height="25" Width="100" Margin="4">
            Mouse Over Me!
        </Button>
    </StackPanel>

</Window>
WPF Change A Controls Font Weidht On Mouse Over








16.74.Font
16.74.1.FontSize unitsFontSize units
16.74.2.Change a Control's Font Weight on Mouse OverChange a Control's Font Weight on Mouse Over
16.74.3.Display Simple Text with TextBlock and set font, alignmentDisplay Simple Text with TextBlock and set font, alignment
16.74.4.Section Font StyleSection Font Style
16.74.5.Adding TextBlock to StackPanel with different font sizeAdding TextBlock to StackPanel with different font size
16.74.6.Using text format property aliasesUsing text format property aliases
16.74.7.Programmatically change the FontFamily property of a TextBlock element.Programmatically change the FontFamily property of a TextBlock element.
16.74.8.Font Properties SampleFont Properties Sample