WPF Combobox选中事件

 

     /// 
        /// 选中事件
        /// 
        /// 
        /// 
        private void cbxList_SelectedIndexChanged(object sender, RoutedEventArgs e)
        {
            //当前选中的索引
            int selectIndex = cbxList.SelectedIndex;
            //当前选中的文本
            string str1 = cbxList.SelectedItem.ToString();
            string str2 = cbxList.SelectedText.ToString();
        }

 

转载于:https://www.cnblogs.com/SeNaiTes/p/9391990.html

你可能感兴趣的:(WPF Combobox选中事件)