usingSystem.Collections.Generic;usingSystem.Windows;usingSystem.Windows.Controls.Primitives;usingSystem.Windows.Input;namespaceWpfApp25
{///
///MainWindow.xaml 的交互逻辑///
public partial classMainWindow : Window
{publicMainWindow()
{
InitializeComponent();var nameList = new List{"A0-Word","B0-Word","C0-Word","A1-Word","A111","A11122","B1-Word","C1-Word","B2-Word","C2-Word","C3-Word",
};
comboBox1.DataContext=nameList;
comboBox1.SelectedValue= "aaa";
comboBox1.Loaded+= delegate{
System.Windows.Controls.TextBox textBox= comboBox1.Template.FindName("PART_EditableTextBox", comboBox1) asSystem.Windows.Controls.TextBox;
Popup popup= comboBox1.Template.FindName("PART_Popup", comboBox1) asPopup;if (te