WPF Combobox选中事件

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

猜你喜欢

转载自www.cnblogs.com/SeNaiTes/p/9391990.html