private void textButton_Click(object sender, EventArgs e) { if (textDialog == null) { textDialog = new TextDialog(this); } if (textDialog.ShowDialog() == DialogResult.OK) { currentShapeType = Shape.Text; SwitchDrawMode(sender); } }