Open In App

How to set the Size of 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 size of Label control using Size Property. You can set this property using two different methods:

1. Design-Time: It is the easiest method to set the Size 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 size of the Label control programmatically with the help of given syntax:



public System.Drawing.Size Size { get; set; }

Here, Size indicates the height and the width of the Label in pixel. Following steps are used to set the Size property of the Label:


Article Tags :
C#