How to set the Visibility of the Label in C#? Last Updated : 30 Jun, 2019 Comments Improve Suggest changes Like Article Like Report 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 visibility of the Label control using the Visible Property in the windows form. The label is visible when the value of this property is set to be true. If the value of this property is set to be false, then the Label does not visible in the form. The default value of this property is true. You can set this property using two different methods: 1. Design-Time: It is the easiest method to set the Visible property of the Label control using the following steps: Step 1: Create a windows form as shown in the below image: Visual Studio -> File -> New -> Project -> WindowsFormApp Step 2: Drag the Label control from the ToolBox and drop it on the windows form. You are allowed to place a Label control anywhere on the windows form according to your need. Step 3: After drag and drop you will go to the properties of the Label control to set the Visible property of the Label. Output: 2. Run-Time: It is a little bit trickier than the above method. In this method, you can set the visibility of the Label control in the windows forms programmatically with the help of given syntax: public bool Visible { get; set; } Here, the value of this property is of System.Boolean type. Following steps are used to set the Visible property of the Label: Step 1: Create a label using the Label() constructor is provided by the Label class. // Creating label using Label class Label mylab = new Label(); Step 2: After creating Label, set the Visible property of the Label provided by the Label class. // Set Visible property of the label mylab.Visible = true; Step 3: And last add this Label control to form using Add() method. // Add this label to the form this.Controls.Add(mylab); Example: CSharp using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApp16 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { // Creating and setting the label Label mylab = new Label(); mylab.Text = "GeeksforGeeks"; mylab.Location = new Point(222, 90); mylab.AutoSize = true; mylab.Font = new Font("Calibri", 18); mylab.ForeColor = Color.Green; mylab.Visible = true; // Adding this control to the form this.Controls.Add(mylab); // Creating and setting the label Label mylab1 = new Label(); mylab1.Text = "Welcome To GeeksforGeeks"; mylab1.Location = new Point(155, 170); mylab1.AutoSize = true; mylab1.Font = new Font("Calibri", 18); mylab1.Visible = false; // Adding this control to the form this.Controls.Add(mylab1); } } } Output: When the value of Visible Property is set to be true: When the value of Visible Property is set to be false: Comment More infoAdvertise with us Next Article How to Set the Visibility of the GroupBox in C#? A ankita_saini Follow Improve Article Tags : C# Similar Reads How to set the Visibility of ListBox in C#? In Windows Forms, ListBox control is used to show multiple elements in a list, from which a user can select one or more elements and the elements are generally displayed in multiple columns. In ListBox, you can set the visibility of the ListBox using Visible Property of the ListBox. If the value of 3 min read How to set the Visibility 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 a value which represents the button and its child buttons are displayed by using the Visible Property. It is provided by Button 3 min read How to set the Visibility of the TextBox in C#? In Windows forms, TextBox plays an important role. With the help of TextBox, the user can enter data in the application, it can be of a single line or of multiple lines. In TextBox, you are allowed to set a value which shows the TextBox control and its all child TextBox controls are displayed and it 3 min read How to set the visibility of the CheckBox in C#? The CheckBox control is the part of the windows form that is used to take input from the user. Or in other words, CheckBox control allows us to select single or multiple elements from the given list. In CheckBox, you are allowed to set a value that represents the CheckBox and its CheckBox controls a 3 min read How to Set the Visibility of the GroupBox in C#? In Windows Forms, GroupBox is a container which contains multiple controls in it and the controls are related to each other. Or in other words, GroupBox is a frame display around a group of controls with a suitable optional title. Or a GroupBox is used to categorize the related controls in a group. 3 min read How to set the Visibility of the ComboBox in C#? In Windows forms, ComboBox provides two different features in a single control, it means ComboBox works as both TextBox and ListBox. In ComboBox, only one item is displayed at a time and the rest of the items are present in the drop-down menu. You are allowed to set the visibility of the ComboBox by 3 min read Like