private void btnAddBlock_Click(object sender, EventArgs e) { var b = new ClassBlock(); var dlg = new dlgBlockInfo(b); if (dlg.ShowDialog() == DialogResult.OK) { b.Name = dlg.BlockName; b.Type = dlg.BlockType; b.PosX = dlg.PosX; b.PosY = dlg.PosY; b.SizeX = dlg.SizeX; diagramView.AddBlock(b); } }
protected override void OnDoubleClick(EventArgs e) { base.OnDoubleClick(e); if (sb != null) { var dlg = new dlgBlockInfo(sb); if (dlg.ShowDialog() == DialogResult.OK) { sb.Name = dlg.BlockName; sb.Type = dlg.BlockType; sb.PosX = dlg.PosX; sb.PosY = dlg.PosY; sb.SizeX = dlg.SizeX; } Invalidate(); } }