Articles in this section
Category / Section

How to create image Button in .NET MAUI Button (SfButton)?

2 mins read

This article explains how to create an image button in .NET MAUI Button. Creating a custom button with an image background involves adjusting the control’s appearance to transform it into an image button. Here, the BackgroundImageSource is used to set the image.
Follow the detailed instructions below to create a button with a background image:
Step 1: Add Images to Your Project
First, ensure you have the images you want to use as buttons in your .NET MAUI project. You can place the images in the project’s resources folder or any other location that suits your project structure.
Step 2: Create a Button with an Image
In your XAML layout, you can create a Button element and set the BackgroundImageSource property to the path of the image you want to use. Here’s an example:
XAML:

<buttons:SfButton x:Name="button" BackgroundImageSource="youtubeimage.png">

Output:

ezgif.com-video-to-gif-converted (2).gif

Conclusion
I hope you enjoyed learning how to create image Button in .NET MAUI Button (SfButton).

Refer to our .NET MAUI Button’s feature tour page for other groundbreaking feature representations. You can explore our .NET MAUI Button documentation to understand how to present and manipulate data.

For current customers, check out our .NET MAUI components from the License and Downloads page. If you are new to Syncfusion, try our 30-day free trial to check out our .NET MAUI Button and other .NET MAUI components.

Please let us know in the following comments section if you have any queries or require clarifications. 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