WPF中的文本框改变事件
开发工具与关键技术:Visual Studio 2017、WPF
撰写时间:2019年8月16日
下面我们做一个文本框的改变事件,在一个文本框输入数值,另一个文本框会发生改变,根据第一个文本框的值发生改变,见下面的XAML代码。
XAML代码如下:
<Window x:Class="文拉框改变事件.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
WindowStartupLocation="CenterScreen"
Title="MainWindow" Height="200" Width="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="1" Text="输入数字:" HorizontalAlignme