/// <summary> /// listBox扩展方法 /// </summary> /// <param name="listBox">操作对象</param> /// <param name="value">设置选中项</param> public static void SetListBoxSelected(this ListBox listBox, string value) { try { listBox.ClearSelection(); listBox.Items.FindByValue(value).Selected = true; } catch { return; } }
时间: 2024-10-10 21:57:29