【发布时间】:2014-03-18 17:32:43
【问题描述】:
我有一个简单的 WPF 网格作为示例,每行具有相同的高度 (*)。三行中的每一行都有一个文本框。我想知道是否可以在 XAML 中指定当文本框获得焦点时,相关行应增加到 2*(从而增加文本框的大小)。
谢谢...
-本
<Window x:Class="WpfApplication2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBox Background="AliceBlue" Grid.Row="0" />
<TextBox Background="AliceBlue" Grid.Row="1" />
<TextBox Background="AliceBlue" Grid.Row="2" />
</Grid>
</Window>
【问题讨论】: