WPF - Make two controls the same size
Posted
by John Michaels
on Stack Overflow
See other posts from Stack Overflow
or by John Michaels
Published on 2010-03-11T18:49:06Z
Indexed on
2010/03/11
18:54 UTC
Read the original article
Hit count: 436
wpf
|wpf-controls
Is there any way to make two controls that are in different containers the same size in WPF? For example, suppose you have two textboxes: textbox1 and textbox2. Textbox1 is in a grid and its size can grow and shrink when the user resizes the window. Textbox2 is in another part of the window and I need it to always have the same size as textbox1. Is there any way to do this?
Keep in mind SharedSizeGroup will not work because the textboxes are in different containers. Also, I've tried binding textbox2's height property to textbox1 and that doesn't seem to work either. Finally, I tried catching textbox1's SizeChanged event, but its Height property is always NaN for some reason.
© Stack Overflow or respective owner