Exemplo n.º 1
0
 /// <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;
         }
     }
 }
Exemplo n.º 2
0
 /// <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);
     }
 }