//右键菜单 private void contextMenuStrip1_Click(object sender, EventArgs e) { contextMenuStrip1.Close(); ToolStripItem mnItem = contextMenuStrip1.GetItemAt((e as MouseEventArgs).Location); if (mnItem == null) { return; } switch (mnItem.Name) { case "m_mnBund": try { if (dataGridView3.SelectedRows.Count > 0) { DataSet1.PadReaderDataRow ReaderRow = (dataGridView3.SelectedRows[0].DataBoundItem as DataRowView).Row as DataSet1.PadReaderDataRow; if (SeqKind == 1) { if (DS.SaveBundInfo(ReaderRow.guid, BarCode, ReaderRow.ST_KIND) == true) { MessageBox.Show(" 绑定成功"); label5.Visible = false; DS.GetPadReaderData(-1); } } else if (SeqKind == 4) { if (DS.SaveBundInfo(ReaderRow.guid, BarCode, ReaderRow.ST_KIND) && DS.SetDateTime(BarCode)) { MessageBox.Show(" 绑定成功"); label5.Visible = false; DS.GetPadReaderData(Convert.ToInt32(lid)); } } } else { MessageBox.Show("请选择要绑定的芯"); } } catch (Exception ex) { MessageBox.Show("绑定ERROR:" + ex.ToString()); } break; case "m_mnPlayViedo": if (dataGridView3.SelectedRows.Count > 0) { DataSet1.PadReaderDataRow ReaderRow = (dataGridView3.SelectedRows[0].DataBoundItem as DataRowView).Row as DataSet1.PadReaderDataRow; PlayInit(DS.GetViedoUrl(ReaderRow.ParMono, SeqName), 800, 670); } else { MessageBox.Show("请选择需要查看哪个工单的工艺资料"); } break; case "m_mnShowAllScreen": if (this.WindowState != FormWindowState.Maximized) { this.TopMost = true; this.FormBorderStyle = FormBorderStyle.None; this.WindowState = FormWindowState.Maximized; this.groupBox3.Parent = this; this.splitContainer1.Visible = false; this.button5.Visible = false; this.m_mnBund.Visible = false; this.m_mnPlayViedo.Visible = false; this.m_mnShowAllScreen.Text = "正常显示"; this.groupBox3.Dock = DockStyle.Fill; this.dataGridView3.Font = new System.Drawing.Font("微软雅黑", 20F); break; } else { this.FormBorderStyle = FormBorderStyle.FixedSingle; this.WindowState = FormWindowState.Normal; this.groupBox3.Parent = this.splitContainer1.Panel1; this.splitContainer1.Visible = true; this.button5.Visible = true; this.m_mnBund.Visible = true; this.m_mnPlayViedo.Visible = true; this.m_mnShowAllScreen.Text = "全屏显示"; this.groupBox3.Dock = DockStyle.None; this.dataGridView3.Font = new System.Drawing.Font("宋体", 12F); break; } } }