I am trying a custom editor dialog box (modal form)which will allow user to edit property values. But the property is shown faded in the properties window. And also the ellipsis button is not visible. Can anybody please assist me in resolving this issue. The code for each of the modules are given below
Code for the UserControl and UITypeEditor
namespace
WindowsApplication1
{
public partial class SSDBCombo : UserControl
{
string _stest = "";
public SSDBCombo()
{
InitializeComponent();
}
[
EditorAttribute(typeof(FormEditorCombo), typeof(UITypeEditor))]
[
BrowsableAttribute(true)]
public string StrTest
{
get
{
return _stest;
}
set
{
_stest =
value;
}
}
}
public abstract class FormEditorCombo : UITypeEditor
{
WindowsApplication1.
UserControlForm m_EditControl;
Boolean m_Escaped;
IWindowsFormsEditorService IEditiorService;
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.Modal;
}
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
{
if (context != null && provider != null)
{
IEditiorService = (
IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
if (IEditiorService != null)
{
string PropName = context.PropertyDescriptor.Name;
m_EditControl =
new UserControlForm();
if (m_EditControl != null)
{
IEditiorService.ShowDialog(m_EditControl);
m_EditControl.SText = value.ToString();
}
return m_EditControl.SText;
}
}
return base.EditValue(context, provider, value);
}
}