public override object EditValue( System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value) { GenericTextEditor editor = new GenericTextEditor(); editor.TextToEdit = (string) value; DialogResult res=editor.ShowDialog(); // Return the new value. if(res==DialogResult.OK) return editor.TextToEdit; else return (string) value; }
/// <summary> /// Edits the values /// </summary> /// <param name="context"></param> /// <param name="provider"></param> /// <param name="value"></param> /// <returns></returns> public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value) { GenericTextEditor editor = new GenericTextEditor(); editor.TextToEdit = (string)value; DialogResult res = editor.ShowDialog(); // Return the new value. if (res == DialogResult.OK) { return(editor.TextToEdit); } else { return((string)value); } }