private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { LayoutData layout = (LayoutData)listBoxLayouts.SelectedItem; if (layout != null) { if (DialogResult.Yes == MessageBox.Show(this, "Delete Layout (" + layout.Name + ")?", "Delete Layout", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)) { SuperPuTTY.RemoveLayout(layout.Name, true); } } }