private void ChangeComment() { int selectedIndex = listBoxClipboard.SelectedIndex; if (selectedIndex != -1) { Buffer buffer = listBoxClipboard.Items[selectedIndex] as Buffer; ChangeCommentForm form = new ChangeCommentForm(buffer.Comment); form.StartPosition = this.Visible ? FormStartPosition.CenterParent : FormStartPosition.CenterScreen; if (form.ShowDialog() == DialogResult.OK) { buffer.Comment = form.Comment; SaveHistoryToFile(); } } }