здравствуите господа
допустим имеем форму с двумья кнопками| Код | <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Grid> <Button Name="b1" Height="106" Margin="0,0,0,156" VerticalAlignment="Bottom">asefaserfqwefqwefw</Button> <Button Height="50" Margin="114,0,114,27" VerticalAlignment="Bottom" Click="Button_Click">asdas</Button> </Grid> </Window>
|
| Код | using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes;
namespace WpfApplication1 { /// <summary> /// Interaction logic for Window1.xaml /// </summary> public partial class Window1 : Window { public Window1() { InitializeComponent(); }
private void Button_Click(object sender, RoutedEventArgs e) { this.b1.Content = this.b1.Width.ToString(); } } }
|
как выудить реалное значение b1.Width?
спосибо
|