| | |
| | | public Frm_MesDefectCode() |
| | | { |
| | | InitializeComponent(); |
| | | tlMenu.ContextMenuStrip = contextMenuStrip1; |
| | | toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; |
| | | this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; |
| | | this.toolBarMenu1.getXmlConfig(); |
| | |
| | | { |
| | | strUpGuid = tlMenu.FocusedNode.GetValue("guid").ToString(); |
| | | } |
| | | Frm_MesDefectCodeShow frm = new Frm_MesDefectCodeShow(strGuid, strUpGuid); |
| | | Frm_MesDefectCodeShow frm = new Frm_MesDefectCodeShow(strGuid, strUpGuid,strType); |
| | | frm.UpdateParent += (s2, ee2) => |
| | | { |
| | | getPageList(1); |
| | |
| | | { |
| | | string strGuid = ""; |
| | | string strUpGuid = ""; |
| | | Frm_MesDefectCodeShow frm = new Frm_MesDefectCodeShow(strGuid, strUpGuid); |
| | | Frm_MesDefectCodeShow frm = new Frm_MesDefectCodeShow(strGuid, strUpGuid, strType); |
| | | frm.UpdateParent += (s2, ee2) => |
| | | { |
| | | getPageList(1); |
| | |
| | | strGuid = tlMenu.FocusedNode.GetValue("guid").ToString(); |
| | | strUpGuid = tlMenu.FocusedNode.GetValue("pid").ToString(); |
| | | } |
| | | Frm_MesDefectCodeShow frm = new Frm_MesDefectCodeShow(strGuid, strUpGuid); |
| | | Frm_MesDefectCodeShow frm = new Frm_MesDefectCodeShow(strGuid, strUpGuid, strType); |
| | | frm.UpdateParent += (s2, ee2) => |
| | | { |
| | | getPageList(1); |
| | |
| | | frm.ShowDialog(); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 右键弹出菜单,如果是行,增加子项目,否则增加主项 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void TlMenu_MouseDown(object sender, MouseEventArgs e) |
| | | { |
| | | if (e.Button == MouseButtons.Right) |
| | | { |
| | | tlMenu.ContextMenuStrip = null; |
| | | TreeListHitInfo hInfo = tlMenu.CalcHitInfo(new Point(e.X, e.Y)); |
| | | TreeListNode node = hInfo.Node; |
| | | tlMenu.FocusedNode = node; |
| | | if (node != null) |
| | | if (hInfo.HitInfoType == HitInfoType.Cell || |
| | | hInfo.HitInfoType ==HitInfoType.Row|| |
| | | hInfo.HitInfoType==HitInfoType.RowIndent || |
| | | hInfo.HitInfoType == HitInfoType.RowIndicator |
| | | ) |
| | | { |
| | | toolStripMenuItemAdd.Visible = true; |
| | | toolStripMenuItemEdt.Visible = true; |
| | | toolStripMenuItemDel.Visible = true; |
| | | toolStripMenuItemRoot.Visible = false; |
| | | tlMenu.ContextMenuStrip = contextMenuStrip1; |
| | | if (node != null) |
| | | { |
| | | toolStripMenuItemAdd.Visible = true; |
| | | toolStripMenuItemEdt.Visible = true; |
| | | toolStripMenuItemDel.Visible = true; |
| | | toolStripMenuItemRoot.Visible = false; |
| | | cms1.Show(tlMenu, e.Location); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | toolStripMenuItemEdt.Visible = false; |
| | | toolStripMenuItemDel.Visible = false; |
| | | toolStripMenuItemRoot.Visible = true; |
| | | tlMenu.ContextMenuStrip = contextMenuStrip1; |
| | | cms1.Show(tlMenu, e.Location); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |