Update textbox changes over label using WPF

Posted by in WPF category on for Beginner level | Points: 250 | Views : 6762 red flag

In this article we will discuss how the text box changes will update Label using WPF


Hi friends today we will discuss how the textbox changes will update Label using WPF.

  1. Once open the Visual Studio click on File Click on the Project .

  1. As you are seeing there are many applications from them Select WPF application .
  2. At name rename it as per your requirement.

  1. Right click on the project and click on add from there click on window for adding a new window to the project
  2. Rename the window as per your requirement.

  1. Drag a text box from tools .
  2. Drag a TextBlock from the tools and rename it has Value..
  3. Based on the below code will update the textbox change on textblock .
<Window x:Class="DataBindingExamples.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <StackPanel Margin="10">
        <TextBox Name="txtValue"/>
        <WrapPanel Margin="0,10">
            <TextBlock Text="Value: " FontWeight="Bold"/>
            <TextBlock Text="{Binding Path=Text, ElementName=txtValue}"/>

Output :

Conclusion : 

In this article we have seen how to update the textbox changes over Label Using WPF.

Page copy protected against web site content infringement by Copyscape

About the Author

Full Name: Pardha Saradhi
Member Level:
Member Status: Member
Member Since: 3/19/2013 2:21:22 PM
Country: India


Login to vote for this post.

Comments or Responses

Login to post response

Comment using Facebook(Author doesn't get notification)