8,834
社区成员
发帖
与我相关
我的任务
分享
public partial class myform: Form
{
....//your code here
}
internal class myeditor : UITypeEditor
{
public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.Modal;
}
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value)
{
IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
if (edSvc != null)
{
myform f = new myform();
// your setting here
edSvc.ShowDialog(f);
}
return value;
}
public override bool GetPaintValueSupported(System.ComponentModel.ITypeDescriptorContext context)
{
return false;
}
}
[EditorAttribute(typeof(myeditor), typeof(System.Drawing.Design.UITypeEditor))]
public youType youProperty
{
get{...}
set{...}
}