// 添加到设计界面 private void toolStripMenuItem1_Click(object sender, EventArgs e) { if (tvw.SelectedNode != null) { string schemaName = tvw.SelectedNode.Text; MySQLSchema mysqlSchema = _SelectedFields.Find(t => t.tbname.Equals(schemaName, StringComparison.CurrentCultureIgnoreCase)); if (splitContainer1.Panel1.Controls.Find(mysqlSchema.tbnick, false).Length > 0) { return; } UC_Table uctable = new UC_Table(mysqlSchema); uctable.Name = mysqlSchema.tbnick; uctable.Close += Uctable_Close; uctable.ClickField += Uctable_ClickField; uctable.AddJoin += Uctable_AddJoin; splitContainer1.Panel1.Controls.Add(uctable); if (uctable.IsAccessible == false) { uctable.BringToFront(); } BuildSelect(); AddSubMenu(); } }
private void AddSubMenu() { foreach (Control getControl in splitContainer1.Panel1.Controls) { if (getControl.GetType().Equals(typeof(UC_Table))) { UC_Table uctable = (UC_Table)getControl; uctable.AddSubMenu(_SelectedFields); } } }