uitypeeditor

How can I override behavior of DockStyle Editor in PropertyGrid

你。 提交于 2019-12-06 05:53:34
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 other way? What we would like to do for our custom panel DockStyle editor in the Property Grid is: 1.

Passing objects to a UITypeEditor

霸气de小男生 提交于 2019-12-05 08:40:01
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 class that manages the list of resources from the UITypeEditor. Now I've solved this problem for my own

How to relabel ellipsis button for modal UITypeEditor in PropertyGrid?

人走茶凉 提交于 2019-12-04 04:10:05
问题 I have a Windows forms PropertyGrid and a customer UITypeEditor per http://msdn.microsoft.com/en-us/library/system.drawing.design.uitypeeditoreditstyle.aspx Displays an ellipsis (...) button to start a modal dialog box, which requires user input before continuing a program, or a modeless dialog box, which stays on the screen and is available for use at any time but permits other user activities. That ellipsis button is pretty small. How can I relabel it with a more helpful label? 回答1: Long

Design-time editor support for controls collection

杀马特。学长 韩版系。学妹 提交于 2019-11-30 07:33:47
I'd like to add a property which represents a collection of controls to a component and have a collection editor with which I can easily select the controls that belong to the collection. VS does almost what I want automatically with the following code: Private _controls As New List(Of Control) <DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _ Public ReadOnly Property SelectedControls() As List(Of Control) Get Return _controls End Get End Property I get the default CollectionEditor, can add and remove controls, and the collection is serialized. The problem is that I

ICustomTypeDescriptor, TypeDescriptionProvider, TypeConverter, and UITypeEditor

假装没事ソ 提交于 2019-11-28 15:48:16
I'm trying to get an overall understanding of how you use ICustomTypeDescriptor, TypeDescriptionProvider, TypeConverter, and UITypeEditor to change how a PropertyGrid displays and interfaces with an object. Can someone tell me if this is right, or if I missed any major concepts or points? I'm really just trying to understand why and when you would use each class. ICustomTypeDescriptor Implementing this interface in a class totaly overrides the native properties of a class and replaces them with the PropertyDescriptors returned by ICustomTypeDescriptor.GetProperties() TypeDescriptionProvider

How do I inject a custom UITypeEditor for all properties of a closed-source type?

折月煮酒 提交于 2019-11-27 23:54:11
I want to avoid placing an EditorAttribute on every instance of a certain type that I've written a custom UITypeEditor for. I can't place an EditorAttribute on the type because I can't modify the source. I have a reference to the only PropertyGrid instance that will be used. Can I tell a PropertyGrid instance (or all instances) to use a custom UITypeEditor whenever it encounters a specific type? Here is an MSDN article that provides are starting point on how to do this in .NET 2.0 or greater. You can usually associate editors etc at runtime via TypeDescriptor.AddAttributes . For example (the

ICustomTypeDescriptor, TypeDescriptionProvider, TypeConverter, and UITypeEditor

北战南征 提交于 2019-11-27 09:21:34
问题 I'm trying to get an overall understanding of how you use ICustomTypeDescriptor, TypeDescriptionProvider, TypeConverter, and UITypeEditor to change how a PropertyGrid displays and interfaces with an object. Can someone tell me if this is right, or if I missed any major concepts or points? I'm really just trying to understand why and when you would use each class. ICustomTypeDescriptor Implementing this interface in a class totaly overrides the native properties of a class and replaces them