Open In App

How to set the Font of the Content Present in the Label in C#?

In windows forms, Label control is used to display text on the form and it does not take part in user input or in mouse or keyboard events. You are allowed to set the font of the content present in the Label control using the Font Property. It makes your label more attractive. You can set this property using two different methods:

1. Design-Time: It is the easiest method to set the Font property of the Label control using the following steps:



2. Run-Time: It is a little bit trickier than the above method. In this method, you can set the font of the text present in the Label control programmatically with the help of given syntax:

public virtual System.Drawing.Color BackColor { get; set; }

Here, Color indicates the background color of the Label. Following steps are used to set the Font property of the Label:


Article Tags :
C#