/// <summary> /// 在主程序界面上清空列表框的显示 /// </summary> /// <remarks></remarks> public void ClearUI() { Visio_DataRecordsetLinkToShape with_1 = this; if (with_1.InvokeRequired) { //非UI线程,再次封送该方法到UI线程 this.BeginInvoke(new BeforeDocumentCloseHander(this.ClearUI)); } else { this.txtbxVsoDoc.Text = ""; this.btnValidate.Enabled = false; this.btnLink.Enabled = false; foreach (ComboBox cbb in this.F_arrCombobox) { try { cbb.DataSource = null; cbb.DisplayMember = LstbxDisplayAndItem.DisplayMember; } catch (Exception) { Debug.Print("重新设置列表框的数据源出错!"); } } } }
public Visio_DataRecordsetLinkToShape() { // This call is required by the designer. InitializeComponent(); // Add any initialization after the InitializeComponent() call. //设置组合列表框中要进行显示的属性 string DisplayMember = LstbxDisplayAndItem.DisplayMember; Visio_DataRecordsetLinkToShape with_1 = this; F_arrCombobox[0] = ComboBox_Page; F_arrCombobox[1] = ComboBox_DataRs; F_arrCombobox[2] = ComboBox_Column_ShapeID; // foreach (ComboBox cbb in this.F_arrCombobox) { cbb.DisplayMember = DisplayMember; } // this.btnLink.Enabled = false; // }