---
title: "Dynamic Bind TextBox Data to Label Control in WPF"  
description: "This is the simple demonstration how to show the text data to label at run time (when input value in text it show also in label control).  In this W"  
author: "maruthi pallamlli"  
published: 2011-06-09  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/549/dynamic-bind-textbox-data-to-label-control-in-wpf  
category: "wpf"  
tags: ["wpf"]  
reading_time: 1 minute  

---

# Dynamic Bind TextBox Data to Label Control in WPF

This is the [simple](https://www.mindstick.com/blog/63525/get-the-most-out-of-maths-with-these-8-simple-tricks) demonstration how to show the [text data](https://answers.mindstick.com/qa/112298/how-do-i-implement-sentiment-analysis-in-text-data) to label at run time (when input [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) in text it show also in [label control](https://www.mindstick.com/articles/301/a-label-control-in-vb-dot-net)).\

In this WPF [application](https://www.mindstick.com/articles/12824/calculator-application-in-android), we take one textbox (for input value) and one label (for [output](https://www.mindstick.com/interview/34427/explain-the-output-in-angular) value).

##### This is the simple code in xaml

```
 <Window x:Class="WpfApplication2.Window1"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     Title="Window1" Height="350" Width="519">    <Grid Height="318" Width="469">          <StackPanel Margin="10,48,91,128" Name="stackPanel1" >            <Label Content="Databind Textbox to label "/>                         <Label Content="Enter Value: "/>            <TextBox Height="30" x:Name="txtinput" Background="AliceBlue" Width="189" AllowDrop="True"   />            <Label Content="Display TextBox Value: "/>            <Label Height="31" Name="label1" Background="AliceBlue" Width="189"  Content="{Binding Text,ElementName=txtinput,UpdateSourceTrigger=PropertyChanged}"></Label>          </StackPanel>      </Grid> </Window>
```

##### Note: highlight portion show the binding text data to content properties of label control.

##### Output:

Run the [program](https://www.mindstick.com/blog/12337/scaling-up-your-mentorship-program) and input the value in textbox it show in label control as here

![Dynamic Bind TextBox Data to Label Control in WPF](https://www.mindstick.com/mindstickarticle/51e2fae3-d7be-45af-a77d-09a86b2738e1/images/0f2c62e4-9c45-45dc-a6f9-e5d5f7227590.png)

So, this is the simple demonstration of how to bind the [textbox data](https://www.mindstick.com/forum/158090/how-to-add-textbox-data-to-the-grid-temporarily-using-knockout-js) to label control at runtime.

You should read also this [Article](https://yourviews.mindstick.com/view/81489/kashmir-now-after-an-year-of-abrogation-of-article-370) - **[Frame control in WPF](https://www.mindstick.com/Articles/543/frame-control-in-wpf)**

---

Original Source: https://www.mindstick.com/articles/549/dynamic-bind-textbox-data-to-label-control-in-wpf

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
