• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 824
  • Last Modified:

Bind a textblock to the value of a textbox

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
KiasChaos83
Asked:
KiasChaos83
1 Solution
 
KiasChaos83Author Commented:
I figured it out..

Adding the following attribute to the textblock made it work

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

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now