Custom Properties
-
Hi, I created a TextBox derivated class and I'd like to link it to a Label using a property, so here is what I need: 1) Create a property editor that shows a list of all available labels in the Page 2) Using the labels name, I need to get the UniqueID (ClientID), so I can use it with javascript. Any tutorials about that? Thanks, Dirso.
-
Hi, I created a TextBox derivated class and I'd like to link it to a Label using a property, so here is what I need: 1) Create a property editor that shows a list of all available labels in the Page 2) Using the labels name, I need to get the UniqueID (ClientID), so I can use it with javascript. Any tutorials about that? Thanks, Dirso.
hi, Here is the code I've got so far, the ListBox works fine, but how do I populate it with the Labels? I can't access the Page object from it, right?
internal class LabelSelectTypeEditor : UITypeEditor { public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) { return UITypeEditorEditStyle.DropDown; } public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService srv = null; if (provider != null) srv = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (srv != null) { System.Windows.Forms.ListBox lb = new System.Windows.Forms.ListBox(); //foreach(Control c in Pa lb.Items.Add("test1"); lb.Items.Add("test2"); srv.DropDownControl(lb); return lb.Text; } return value; } }
Thanks, Dirso
-
hi, Here is the code I've got so far, the ListBox works fine, but how do I populate it with the Labels? I can't access the Page object from it, right?
internal class LabelSelectTypeEditor : UITypeEditor { public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) { return UITypeEditorEditStyle.DropDown; } public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService srv = null; if (provider != null) srv = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (srv != null) { System.Windows.Forms.ListBox lb = new System.Windows.Forms.ListBox(); //foreach(Control c in Pa lb.Items.Add("test1"); lb.Items.Add("test2"); srv.DropDownControl(lb); return lb.Text; } return value; } }
Thanks, Dirso