Example #1
0
        private void tbtEdit_Click(object sender, EventArgs e)
        {
            if (listDiagram.SelectedItems.Count == 0)
            {
                MessageBox.Show("请选择一项!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            CDiagram Diagram = (CDiagram)listDiagram.SelectedItems[0].Tag;

            DiagramInfoForm frm = new DiagramInfoForm();

            frm.m_Diagram = Diagram;
            if (frm.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            listDiagram.SelectedItems[0].Text = frm.m_Diagram.Name;
        }
Example #2
0
        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();
        }