wpf 选择项

xaml

<ComboBox x:Name=”cbb_ConfigEncryption” Margin=”421,7,0,30″ HorizontalAlignment=”Left” Width=”97″ Text=”加密” SelectionChanged=”cbb_ConfigEncryption_SelectionChanged”>
<ComboBoxItem Content=”加密”/>
<ComboBoxItem Content=”不加密”/>
</ComboBox>

c#

private void cbb_ConfigEncryption_SelectionChanged(object sender, SelectionChangedEventArgs e)
{

ComboBoxItem item = cbb_ConfigEncryption.SelectedItem as ComboBoxItem;
string a=item.Content.ToString() ;

}