首页 > 代码库 > 下拉框-ComboBox

下拉框-ComboBox

 

<ComboBox Name="cbBox" SelectionChanged="cbBox_SelectionChanged"></ComboBox>

 

ComboBoxItem item = new ComboBoxItem();
item.Name = voice.DisplayName;
item.Tag = voice;
item.Content = voice.DisplayName + " (Language: " + voice.Language + ")";
cbBox.Items.Add(item);

 

private void cbBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{

  ComboBoxItem item = (ComboBoxItem)(cbBox.SelectedItem);

}

下拉框-ComboBox