Articles in this section
Category / Section

How to remove the default focus border of .NET MAUI TreeView (SfTreeView)?

1 min read

You can remove the default focus border for the .NET MAUI TreeView control by setting the UseSystemFocusVisuals property of PlatformView to false.

treeView.Loaded += TreeView_Loaded; 

private void TreeView_Loaded(object? sender, Syncfusion.Maui.TreeView.TreeViewLoadedEventArgs e)
{
#if WINDOWS
    var nativeView = treeView.Handler!.PlatformView as Microsoft.UI.Xaml.FrameworkElement;
    if (nativeView != null)
    {
        nativeView.UseSystemFocusVisuals = false;
    }
#endif
}

Download the complete sample from GitHub

Conclusion

I hope you enjoyed learning how to remove the default focus border of .NET MAUI TreeView.

You can refer to our .NET MAUI TreeView feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started with configuration specifications. Explore our .NET MAUI TreeView example to understand how to create and manipulate data.

You can check out our components from the License and Downloads page for current customers. If you are new to Syncfusion®, try our 30-day free trial to check out our other controls.

If you have any queries or require clarification, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied