public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if ((context != null) && (provider != null)) { // Access the Property Browser's UI display service IWindowsFormsEditorService editorService = (IWindowsFormsEditorService) provider.GetService(typeof(IWindowsFormsEditorService)); if (editorService != null) { // Create an instance of the UI editor control //ColorUIEditorCtrl dropDownEditor = // new ColorUIEditorCtrl(editorService); ColorUIEditorCtrl dropDownEditor = new ColorUIEditorCtrl((Color)value, editorService); //// Pass the UI editor control the current property value dropDownEditor.Value = (Color)value; // Display the UI editor control editorService.DropDownControl(dropDownEditor); value = dropDownEditor.Value; // Return the new property value from the UI editor control return(value); } } return(base.EditValue(context, provider, value)); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if ((context != null) && (provider != null)) { // Access the Property Browser's UI display service IWindowsFormsEditorService editorService = (IWindowsFormsEditorService) provider.GetService(typeof(IWindowsFormsEditorService)); if (editorService != null) { // Create an instance of the UI editor control //ColorUIEditorCtrl dropDownEditor = // new ColorUIEditorCtrl(editorService); ColorUIEditorCtrl dropDownEditor = new ColorUIEditorCtrl((Color)value, editorService); //// Pass the UI editor control the current property value dropDownEditor.Value = (Color)value; // Display the UI editor control editorService.DropDownControl(dropDownEditor); value = dropDownEditor.Value; // Return the new property value from the UI editor control return value; } } return base.EditValue(context, provider, value); }
public ColorUIEditorForm() { // // Required for Windows Form Designer support // InitializeComponent(); m_ColorCtrl = new ColorUIEditorCtrl(); m_ColorCtrl.OKClick += new EventHandler(m_ColorCtrl_OKClick); m_ColorCtrl.CancelClick += new EventHandler(m_ColorCtrl_CancelClick); this.Controls.Add(m_ColorCtrl); }
public ColorUIEditorForm() { // // Required for Windows Form Designer support // InitializeComponent(); m_ColorCtrl = new ColorUIEditorCtrl(); m_ColorCtrl.OKClick += new EventHandler(m_ColorCtrl_OKClick); m_ColorCtrl.CancelClick += new EventHandler(m_ColorCtrl_CancelClick); this.Controls.Add(m_ColorCtrl); }