Solved

Bind a textblock to the value of a textbox

Posted on 2010-08-15
1
814 Views
Last Modified: 2012-08-14
I have a textblock

<TextBlock Height="43" HorizontalAlignment="Left" Margin="12,12,0,0" Name="textBlock2" Text="TheCompany" VerticalAlignment="Top" Width="818" TextAlignment="Center" FontSize="20" Foreground="#FF767C96" FontWeight="Normal" FontStyle="Normal" FontStretch="Normal" FontFamily="Georgia" />

And I want to have it bound to the value of a textbox

<TextBox Grid.Column="1" Grid.Row="1" Height="23" HorizontalAlignment="Left" Margin="6,2,0,0" Name="textBox1" VerticalAlignment="Top" Width="253" />

How do I do that? Both these controls are in the same grid object.

Thank you
0
Comment
Question by:KiasChaos83
1 Comment
 
LVL 5

Accepted Solution

by:
KiasChaos83 earned 0 total points
ID: 33442727
I figured it out..

Adding the following attribute to the textblock made it work

Text="{Binding ElementName=txtPartnerName, Path=Text}"
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C# parent child form 5 29
2 questions 10 25
Hey!!!! 1 22
Unable to connect C# program to an SQL database - Exception occurs. 4 22
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question