private void pictureBox1_MouseClick(object sender, MouseEventArgs e) { if (!(currentHandler is null)) { if (e.Button == MouseButtons.Left) { currentHandler.MouseClick(e); } if (e.Button == MouseButtons.Right) { foreach (var element in canvas.listAbstractDiagramElements) { if (element is AbstractUMLElement) { AbstractUMLElement currentClass = (AbstractUMLElement)element; if (currentClass.CheckIfTheObjectIsClicked(e.Location)) { currentClassTextList = currentClass.CheckSelectedList(); EditClassTextForm editClassTextForm = new EditClassTextForm(currentClassTextList); editClassTextForm.StartPosition = FormStartPosition.CenterParent; editClassTextForm.ShowDialog(); } } } } } }