/// <summary> /// 双击条目 /// </summary> private void pathContentValue_DoubleClick(object sender, EventArgs e) { if (pathContentValue.SelectedIndex >= 0) { EditDialog dialog = new EditDialog(pathContentValue.SelectedItem.ToString()); if (dialog.ShowDialog() == DialogResult.OK) { pathContentValue.Items[pathContentValue.SelectedIndex] = dialog.ResultValue; } } }
/// <summary> /// 编辑按钮 /// </summary> private void edit_Click(object sender, EventArgs e) { if (pathContentValue.SelectedIndex >= 0) { EditDialog dialog = new EditDialog(pathContentValue.SelectedItem.ToString()); if (dialog.ShowDialog() == DialogResult.OK) { pathContentValue.Items[pathContentValue.SelectedIndex] = dialog.ResultValue; } } else { MessageBox.Show("请选择要修改的值!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } }