1. treeview的Item获取
var g = this.tree.ItemContainerGenerator; TreeViewItem item = g.ContainerFromItem(this.tree.SelectedItem) as TreeViewItem; if (item != null) item.IsExpanded = true;
2.ListBox
var g = listbox实例.ItemContainerGenerator; ListBoxItem item = g.ContainerFromIndex(listbox实例.SelectedIndex) as ListBoxItem
3.Combobox
(comboBox1.ItemContainerGenerator.ContainerFromIndex(comboBox1.SelectedIndex) as ComboBoxItem).Content.ToString()