A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/c-sharp/how-to-set-the-location-of-the-label-in-c-sharp/ below:

How to Set the Location of the Label in C#?

How to Set the Location of the Label in C#?

Last Updated : 30 Jun, 2019

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 location of the Label control using the

Location Property

in the windows form. This property contains the coordinates of the upper-left corner of the Label control relative to the upper-left corner of its form. You can set this property using two different methods:

1. Design-Time:

It is the easiest method to set the Location 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 location of the Label control in the windows forms programmatically with the help of given syntax:

public System.Drawing.Point Location { get; set; }

Here, the Point indicates the upper-left corner of the Label control relative to the upper-left corner of its form. Following steps are used to set the Location property of the Label:



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4