private void penWidthMenuItem_Click(object sender, EventArgs e) { PenDialog dlg = new PenDialog(); dlg.PenWidth = penWidth; if (dlg.ShowDialog() == DialogResult.OK) { penWidth = dlg.PenWidth; } }