private void mTabControl1_SelectedChanged() { #region 关闭激活 for (int index = 0; index < dtpControl.Controls.Count; index++) { ItemControl oneCtrl = dtpControl.Controls[index] as ItemControl; oneCtrl.SetActive(false); } for (int index = 0; index < dtpBase.Controls.Count; index++) { ItemControl oneCtrl = dtpBase.Controls[index] as ItemControl; oneCtrl.SetActive(false); } for (int index = 0; index < dtpCollection.Controls.Count; index++) { ItemControl oneCtrl = dtpCollection.Controls[index] as ItemControl; oneCtrl.SetActive(false); } itemInfo.Text = ""; #endregion }
private void ic_FocusChangeEvent(object sender, ActiveEventArgs e) { ItemControl ic = sender as ItemControl; if (ic == null) { return; } // 修改鼠标状态 ItemClass itemData = ic.getData(); dpDrawPanel.setCursor(e.State, itemData); if (itemData.itemtype == ItemType.Control) { for (int index = 0; index < dtpControl.Controls.Count; index++) { ItemControl oneCtrl = dtpControl.Controls[index] as ItemControl; if (oneCtrl.Name == ic.Name) { continue; } oneCtrl.SetActive(false); } } else if (itemData.itemtype == ItemType.Module) { for (int index = 0; index < dtpBase.Controls.Count; index++) { ItemControl oneCtrl = dtpBase.Controls[index] as ItemControl; if (oneCtrl.Name == ic.Name) { continue; } oneCtrl.SetActive(false); } } else if (itemData.itemtype == ItemType.Collection) { for (int index = 0; index < dtpCollection.Controls.Count; index++) { ItemControl oneCtrl = dtpCollection.Controls[index] as ItemControl; if (oneCtrl.Name == ic.Name) { continue; } oneCtrl.SetActive(false); } } itemInfo.Text = itemData.itemInfo; }