Open In App

How to set the Font of the Button in C#?

A Button is an essential part of an application, or software, or webpage. It allows the user to interact with the application or software. In Button, you are allowed to set the font of the button by using Font property. It is provided by Button class which helps programmers in creating more interactive or good looking buttons in the windows forms. You can use this property in two different methods:

1. Design-Time: It is the easiest method to set the font of the button. Using the following steps you will set the Font property of the button:



2. Run-Time: It is a little bit trickier than the above method. In this method, you can set the Font property of the Button programmatically with the help of given syntax:



public virtual System.Drawing.Font Font { get; set; }

Here, the Font represents the font in which you want to display your text. Following steps are used to set the Font property of the Button:


Article Tags :
C#