uitypeeditor

Custom ColorEditor does not work properly on Color struct

二次信任 提交于 2019-12-12 10:04:54
问题 I asked here how to use custom color dialog in property grid for Color struct: Using custom color picker dialog in PropertyGrid From that link you can see code of MyColorEditor class if needed. Now i can use custom color dialog but only if i use my own struct which is RGBA in that example. If i use this custom type editor on color struct it looks like this in property grid: But if i use RGBA struct which i created, it looks properly: Problem happens because UITypeEditorEditStyle.Modal not

PropertyGrid PaintValue issue: How to remove (and paint outside) the standard rectangle?

这一生的挚爱 提交于 2019-12-11 10:59:20
问题 This might be a straightforward question, even though I haven't found an easy solution to it: I've implemented my custom UITypeEditor with the sole purpose of adding a PaintValue to bools. For the sake of the discussion, let's assume that PaintValue will either paint a checked or unchecked radiobutton. Question 1: Now, here's the problem: It seems like PaintValue automatically inserts a 20x13px rectangle after all paint code has completed. Naturally, a radiobutton inside a black rectangle is

How to save collection data in Design Time with Custom UITypeEditor C# WindowsFormApplication?

随声附和 提交于 2019-12-11 05:46:21
问题 I wrote my own UITypeEditor and I reached my goal with help of @Sefe and with THIS link. My basic setup: In this setup, BaseForm extends System.Windows.Forms.Form . Here i'm putting my property ( List<Control> ActionButtons ) that have a custom UITypeEditor like a modal style. Resumed workflow (All here are in Design Time): 1 - Open MyForm. 2 - Click at ActionButtons(inherited by BaseForm) ellipsis [...] on MyForm properties panel. 3 - A custom form is opened with inflated objects that I want

How to create a PropertyGrid editor that limits a string to n characters

好久不见. 提交于 2019-12-11 05:06:29
问题 I have attempted to create my own UITypeEditor but the EditValue method never gets called public class BoundedTextEditor : UITypeEditor { public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context) { return UITypeEditorEditStyle.None; } public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value) { if (value.GetType() != typeof(string)) return value; var

Propertygrid UIEditor disabling value editing through Keyboard

谁说胖子不能爱 提交于 2019-12-11 02:04:38
问题 I have a propertygrid that uses UITypeEditor to display a Listbox and select a item. This item gets returned on the proertygrid on selection. But how do I disable editing of the selected item directly, readonly option prevents it from getting edited. Let's say I'm changing a Property Country from another form which displays a list of countries in a listbox. When I select 'Algeria' and press OK, 'Algeria' is displayed across Country, but I can directly edit Algeria to any other value,

Insert custom TypeConverter on a property at runtime, from inside a custom UITypeEditor

≯℡__Kan透↙ 提交于 2019-12-10 22:18:25
问题 I've created a custom UITypeEditor. Can I possibly insert an attribute that also attaches a TypeConverter to my property from inside the UITypeEditor class? I've tried the following, but nothing happens, no matter how I twist and turn it: Attribute[] newAttributes = new Attribute[1]; newAttributes[0] = new TypeConverterAttribute(typeof(BooleanConverter)); Now, the above needs to have the following attached to it somehow: TypeDescriptor.AddAttributes(context.Instance.PROPERTYNAME,

How can I override behavior of DockStyle Editor in PropertyGrid

二次信任 提交于 2019-12-08 01:36:41
问题 We have a custom panel which inherits Panel and has an Orientation property implemented similarly to the SplitContainer Orientation property. For our custom panel, DockStyle.Fill is never valid and depending on the Orientation property value, DockStyle needs to be Left or Right for Vertical or Top or Bottom for Horizontal. The DockStyleEditor class is sealed so we can't subclass it for our own custom UITypeEditor. Is there a way to override certain behaviors using a TypeDescriptor or some

Passing objects to a UITypeEditor

為{幸葍}努か 提交于 2019-12-07 05:55:40
问题 I am currently hoping to use a PropertyGrid to allow users to edit some of my classes, however I've hit a wall with passing objects to the UITypeEditor(s) they use. When the user presses the drop down I want to show a listbox of already loaded textures to choose from, if they want to use a texture the application hasn't loaded yet they can click a button to choose one from a file dialog. In case I make no sense here a mock of the form: . My problem: To fill the listbox I need access to the

Custom ColorEditor does not work properly on Color struct

旧街凉风 提交于 2019-12-06 15:09:08
I asked here how to use custom color dialog in property grid for Color struct: Using custom color picker dialog in PropertyGrid From that link you can see code of MyColorEditor class if needed. Now i can use custom color dialog but only if i use my own struct which is RGBA in that example. If i use this custom type editor on color struct it looks like this in property grid: But if i use RGBA struct which i created, it looks properly: Problem happens because UITypeEditorEditStyle.Modal not applying with GetEditStyle() i think. Using Color struct can be better than using my custom color struct

How do you hook an editor for TFS 2010 WF BuildProcessTemplate arguments for built-in types that have a converter?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 11:25:27
I've followed the Team Foundation Server 2010 book 's custom editor for a dictionary<string,string> and can't get it to go. I have another custom editor in the same assembly, and consumed by the same build template that works. This SO hints at it being a TypeConverter issue, but I don't think any part of a custom build assembly is just run when it is loaded. I'm getting the default generic Collection Editor instead of mine. I have tried using code more like my credential UITypeEditor uses, and then tried typing exactly what's in the book for a UITypeEditor . The dialog itself should not matter