private void tbtOpen_Click(object sender, EventArgs e) { if (listDiagram.SelectedItems.Count == 0) { MessageBox.Show("请选择一项!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } CDiagram Diagram = (CDiagram)listDiagram.SelectedItems[0].Tag; DesignerForm frm2 = new DesignerForm(); frm2.m_Diagram = Diagram; frm2.Show(); }
private void tbtNew_Click(object sender, EventArgs e) { DiagramInfoForm frm = new DiagramInfoForm(); if (frm.ShowDialog() != DialogResult.OK) { return; } ListViewItem item = new ListViewItem(); item.Text = frm.m_Diagram.Name; item.ImageIndex = 0; item.Tag = frm.m_Diagram; listDiagram.Items.Add(item); DesignerForm frm2 = new DesignerForm(); frm2.m_Diagram = frm.m_Diagram; frm2.Show(); }