---
title: "A Label Control in VB.Net"  
description: "Label control is used to display Text on the Form. Main property of the label control is the text property which is used to set the text in the label."  
author: "Pushpendra Singh"  
published: 2010-12-14  
updated: 2020-03-28  
canonical: https://www.mindstick.com/articles/301/a-label-control-in-vb-dot-net  
category: "vb.net"  
tags: ["vb.net"]  
reading_time: 1 minute  

---

# A Label Control in VB.Net

## A Label Control in VB.Net

The [Label control](https://www.mindstick.com/articles/389/label-control-in-c-sharp-dot-net) is used to [display Text on the Form](https://www.mindstick.com/Beginner/1091/ienumerable-ienumerator-icollection-and-ilist-in-c-sharp). The main property of the label control is the [text property](https://www.mindstick.com/forum/161/problem-in-getting-text-property-for-sender-object) which is used to set the text in the label.\

[Drag and drop](https://www.mindstick.com/forum/454/how-to-drag-and-drop-multiple-image-from-one-canvas-to-onther-canvas-in-html5) Label control from the toolbox on the [window Form](https://www.mindstick.com/forum/527/how-to-pass-datagridview-s-cells-value-to-another-window-form).

![Label Control in VB.Net](https://www.mindstick.com/mindstickarticle/9a63504d-ede1-49ec-b076-aee0125abc8a/images/195aa141-8e55-4b32-8da0-fca8df0662e0.png)

Display Text in Label.

```
Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load         'display text in Label         Label1.Text = "Hello" End Sub
```

The text will display in Label when Form gets executed.

![Label Control in VB.Net](https://www.mindstick.com/mindstickarticle/9a63504d-ede1-49ec-b076-aee0125abc8a/images/7b21d0a3-02d3-4147-82a1-586f0e290842.png)

**The main event** of Label is the [Click event](https://www.mindstick.com/forum/424/how-to-call-form_paint-event-on-button-click-event).

```
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click         'MessageBox will show message         MessageBox.Show("How are you")End Sub
```

![Label Control in VB.Net](https://www.mindstick.com/mindstickarticle/9a63504d-ede1-49ec-b076-aee0125abc8a/images/7b21d0a3-02d3-4147-82a1-586f0e290842.png)\

When you click on the Text Hello is written in Label then click event will fire and the [message](https://www.mindstick.com/interview/682/which-are-the-various-message-map-macros) box will display the message.

![Label Control in VB.Net](https://www.mindstick.com/mindstickarticle/9a63504d-ede1-49ec-b076-aee0125abc8a/images/2ed7e23f-8162-4096-9822-c3dc63b247fb.png)

**Label Control [Properties](https://yourviews.mindstick.com/view/81845/now-it-s-possible-to-predict-properties-of-any-molecule)**

## ForeColor:

The ForeColor of Label can be changed through the ForeColor Property of Label.

```
Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load         'change Label ForeColor         Label1.ForeColor = Color.RedEnd Sub
```

![Label Control in VB.Net](https://www.mindstick.com/mindstickarticle/9a63504d-ede1-49ec-b076-aee0125abc8a/images/72856dbe-522f-4cf1-8a63-ee360fdfc147.png)\

---

Original Source: https://www.mindstick.com/articles/301/a-label-control-in-vb-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
