日期:2014-05-17 浏览次数:20891 次
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value) { System.Windows.Forms.Design.IWindowsFormsEditorService service =(System.Windows.Forms.Design.IWindowsFormsEditorService)provider.GetService(typeof(System.Windows.Forms.Design.IWindowsFormsEditorService)); if (service == null) { return null; } PropertyWindow form = new PropertyWindow(); form.TableName="这里需要这个自定义控件的其他属性值"; if (service.ShowDialog(form) == DialogResult.OK) { return form.SelectedValue; } return value; }
MyControl my = context==null ? null : context.Instance as MyControl; if(my != null) { form.TableName = my.XXX; }