using Api.Framework.Model; using System; using System.Collections.Generic; using System.Windows.Forms; using UI.Framework.Forms; namespace FLSystem.Forms { public partial class member_reelect_group : BaseForm { List memberGroup = null; public member_reelect_group(List memberGroup) { InitializeComponent(); this.memberGroup = memberGroup; } private void member_reelect_group_Load(object sender, EventArgs e) { if (memberGroup != null && memberGroup.Count != 0) { var infoList = new List(); foreach (var item in memberGroup) { infoList.Add(new { Id = item.id.ToString(), Name = item.name }); } comboBox1.DataSource = infoList; comboBox1.ValueMember = "Id"; comboBox1.DisplayMember = "Name"; } } public string id = string.Empty; private void button1_Click(object sender, EventArgs e) { id = comboBox1.SelectedValue.ToString(); this.DialogResult = DialogResult.OK; } } }