How to hide the .NET MAUI Slider (SfSlider) thumb?
In the Syncfusion® .NET MAUI Slider control, you can remove the thumb and overlay from the slider by following these steps:
Step 1: Create a .NET MAUI application project in Visual Studio.
Step 2: Add the Syncfusion.Maui.Sliders NuGet to the project from nuget.org.
- Open the NuGet package manager in Visual Studio.
- Search for Syncfusion.Maui.Sliders and install it.
Step 3: In the MauiProgram.cs file, register the Syncfusion.Maui.Core handler as shown below.
The Syncfusion.Maui.Core package is dependent on Syncfusion.Maui.Sliders NuGet package, and it will be installed automatically when you install the Syncfusion.Maui.Sliders package.
Using C#
using Syncfusion.Maui.Core.Hosting; namespace SliderDemo { public static class MauiProgram { public static MauiApp CreateMauiApp() { var builder = MauiApp.CreateBuilder(); builder .UseMauiApp<App>() .ConfigureSyncfusionCore(); // Handler for Syncfusion Core project return builder.Build(); } } }
Step 4: Add the .NET MAUI Sliders control namespace to the MainPage.xaml.
Using XAML
xmlns:sliders="clr-namespace:Syncfusion.Maui.Sliders;assembly=Syncfusion.Maui.Sliders"
Using C#
using Syncfusion.Maui.Sliders;
Step 5: To remove the thumb and overlay from the slider, set the Radius property of the ThumbStyle and ThumbOverlayStyle classes to 0:
Using Xaml
<sliders:SfSlider > <sliders:SfSlider.ThumbStyle> <sliders:SliderThumbStyle Radius="0"/> </sliders:SfSlider.ThumbStyle> <sliders:SfSlider.ThumbOverlayStyle> <sliders:SliderThumbOverlayStyle Radius="0"/> </sliders:SfSlider.ThumbOverlayStyle> </sliders:SfSlider>
Using C#
SfSlider slider = new SfSlider(); slider.ThumbStyle.Radius = 0; slider.ThumbOverlayStyle.Radius = 0;
Output
Conclusion
I hope you enjoyed learning how to hide the .NET MAUI Slider thumb.
You can refer to our .NET MAUI Slider feature tour page to learn about its other groundbreaking feature representations. Explore our .NET MAUI Slider documentation to understand how to present and manipulate data. You can check out our .NET MAUI 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 .NET MAUI Slider and other .NET MAUI components.
If you have any queries or require clarification, please let us know in the comment section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!