DataTable dt = new DataTable();
dt.Columns.Add("name"); dt.Columns.Add("value"); for (int i = 0; i < pilotPathList.Count; i++) { DataRow dr = dt.NewRow(); dr[0] = pilotPathList[i]; dr[1] = i.ToString(); dt.Rows.Add(dr); } cbxSelectPilot.DataSource = dt; cbxSelectPilot.DisplayMember = "name"; cbxSelectPilot.ValueMember = "value"; cbxSelectPilot.SelectedIndex = 0; --------------------- 作者:lwjkhx 来源:CSDN 原文:https://blog.csdn.net/lwjzjw/article/details/80568408 版权声明:本文为博主原创文章,转载请附上博文链接!