日期:2014-05-17 浏览次数:21132 次
<Window x:Class="WpfApplication3.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="3*" />
</Grid.RowDefinitions>
<Label Content="{Binding ElementName=comb, Path=SelectedValue.Content, Mode=OneWay}" />
<ComboBox Grid.Row="1" Height="23" HorizontalAlignment="Left" Width="120" Name="comb" >
<ComboBoxItem Content="1" />
<ComboBoxItem Content="2" />
<ComboBoxItem Content="3" />
<ComboBoxItem Content="4" />
<ComboBoxItem Content="5" />
<ComboBoxItem Content="6" />
<ComboBoxItem Content="7" />
</ComboBox>
</Grid>
</Window>