How to Set a Button Background as an Image in C# – Programming, Pseudocode Example, C# Programming Example
C# Windows Form

How to Set a Button Background as an Image in C#

The Image property of a Button control is used to set a button background as an image.

The Image property needs an Image object.

The Image class has a static method called FromFile that takes an image file name with full path and creates an Image object.

You can also align image and text. The ImageAlign and TextAlign properties of Button are used for this purpose.

The following code snippet sets an image as a button background.

Output:

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.