WPF TextBlock Style Underline on Mouse Hover

Error processing SSI file

Answers

  1. Jayceon

    • 2020/9/18

    Add the style as resource; then at least you can re-use it. I think that's the best you can do.

    <Application.Resources>
        <Style TargetType="TextBlock" x:Key="HoverUnderlineStyle">
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="TextBlock.TextDecorations" Value="Underline" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </Application.Resources>
    
    <TextBlock Style="{StaticResource HoverUnderlineStyle}" />
    
  2. Tadeo

    • 2018/3/8

    Have you every seen CSS? I only want to underline the Text when I hover with the mouse just like a link. Do I really have to add 9 lines for that?

  3. Hugo

    • 2018/11/6

    WPF TextBlock Style Underline on Mouse Hover. Ask Question Asked 8 years, 10 months ago. Active 7 years, 1 month ago. Viewed 14k times 12 2. Simple question. Can the

  4. Thomas

    • 2018/10/30

    c# - WPF TextBlock style underline on mouse over. Simple question. I only want to underline the Text when I hover with the mouse just like a link.

  5. Michel

    • 2019/6/19

    <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:custom="clr-namespace:MyLabelControl;assembly=MyLabelControl" > <Style TargetType="custom:MyLabel"> <Setter Property="IsTabStop" Value="False"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="custom:MyLabel"> <StackPanel Orientation="Horizontal"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="Mouse

  6. Cason

    • 2017/3/17

    Hello,. I created a style for a TextBlock control, and put it in a DictionnaryFile.xaml. I'm using Blend 3.

  7. James

    • 2017/8/15

    Solution 2. Accept Solution Reject Solution. XML. Expand Copy Code. If someone doesn't want to override default Control Template then here is the solution. You can create DataTemplate for button which can have TextBlock and then you can write Property trigger on IsMouseOver property to disable mouse over effect.

  8. Jaxen

    • 2017/1/30

    1) Put in the template is just a TextBlock, and add style to it, a trigger that when you hover will set the attribute value of the TextDecoration to Underline.

  9. Mazza

    • 2015/10/22

    I am working in Wpf I set Trigger on textblock for Change Background and Foreground But Foreground Color is Not Change.. to specify the style to be used

  10. Gustavo

    • 2017/10/29

    Changing Hyperlink foreground without losing hover color. Solution: Setting the Foreground directly (as you've done) doesn't work, and setting it in a Style 

  11. Marcelo

    • 2018/12/26

    You can change the text color (and much more) of entire row on mouse hover. Use the following style. <igDP:XamDataGrid.Resources> <Style TargetType="{x:Type igDP:DataRecordCellArea}"> <Setter Property="ForegroundHoverStyle"> <Setter.Value> <Style> <Setter Property="TextBlock.FontFamily" Value="Arial" />

  12. Bennet

    • 2018/12/22

    When having a clickable textblock in a listview, there is a blue highlight around the text block that appears before hovering over the 

  13. Roman

    • 2019/7/22

    a style that suits your current Windows theme, which will usually be some sort of underlined blue text with a red hover effect and a hand mouse cursor.

  14. Morelli

    • 2017/2/7

    Hello - I have spent the better part of 2 hours attempting to figure out how to make the text in a tabitem underline when the mouse is over the …

  15. Jeremias

    • 2016/10/12

    NET 4, Professional C# 4, VB 2010 Programmer's Ref, WPF Programmer's Ref, the mouse over a hyperlink on a page using this CSS file, an underline and an 

Comments are closed.

More Posts