How to remove underline when Entry receives focus in maui for windows?

Jeff Pfahl 91 Reputation points
2022-06-17T15:01:16.717+00:00

When an Entry receives focus it displays a border and underline. I am handling focus indication in a different way and do not what the default styling.

Setting UseSystemFocusVisuals to false does not fix it.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,844 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 25,996 Reputation points Microsoft Vendor
    2022-06-20T08:42:59.507+00:00

    Hello @Jeff Pfahl ,

    Please check TextControlBorderThemeThicknessFocused in Windows UI Library, and set Thickness 0. Try to add the following code in App.xaml under Platforms/ Windows :

       <maui:MauiWinUIApplication.Resources>  
            <Thickness x:Key="TextControlBorderThemeThickness">0</Thickness>  
            <Thickness x:Key="TextControlBorderThemeThicknessFocused">0</Thickness>  
        </maui:MauiWinUIApplication.Resources>  
    

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    2 people found this answer helpful.