collectioneditor

Design-time editor support for controls collection

邮差的信 提交于 2019-12-30 02:29:24
问题 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

VB.Net items added via the designer not reflected on code

淺唱寂寞╮ 提交于 2019-12-13 18:44:46
问题 I have a usercontrol which exposes a property of a custom collection. Here is the code used in the usercontrol. Imports System.ComponentModel.DesignerSerializationVisibility Public Class textbox Inherits System.Windows.Forms.TextBox Private _validation As New validationList <System.ComponentModel.DesignerSerializationVisibility(Content)> Public Property Validation As validationList Get Return _validation End Get Set(ByVal value As validationList) _validation = value End Set End Property End

How do you customize the descriptions in the Collection Editor of the PropertyGrid object?

最后都变了- 提交于 2019-12-13 15:05:34
问题 I have a class that contains several public properties. One of those properties is a List containing instances of another class. It breaks down something like this: namespace Irig106Library.Filters.PCM { [Description("Definition")] public class MinorFrameFormatDefinition { [Description("Word Number")] public int WordNumber { get; set; } [Description("Number of Bits")] public int NumberOfBits { get; set; } } public class MinorFrame { // ... other properties here [Category("Format")]

CollectionEditor yielding “Object does not match target type.” for System.Drawing.Point

耗尽温柔 提交于 2019-12-12 07:57:34
问题 I have a custom control which has a property of type Collection<System.Drawing.Point> . When I use CollectionEditor to edit this property, the CollectionEditor window shows "Object does not match target type." for the "X" and "Y" properties. But if I use System.Drawing.PointF instead, there's no failure. Can anyone please explain why this difference occurs? 回答1: The difference between Point and PointF lies indeed with PointConverter. Why this causes a problem is quite a long story, but at the

WinForm propertygrid Collection Editor Add/Remove buttons Inactive

穿精又带淫゛_ 提交于 2019-12-11 11:47:30
问题 I am using the generic propertygrid to edit values from several custom classes. Some of these classes have collections and I can open those collections without a problem in the Collection Editor without a problem. If the collection already contains objects I am able to select those objects and edit them on the right, but the the Add/Remove buttons are inactive. I know for some of these collections are going to need a custom editor as they are quite complicated-- but most of them are quite

set not being called when editing a collection

天涯浪子 提交于 2019-12-11 08:24:34
问题 I have a class containing a collection property which I want to display and edit in a property grid: [EditorAttribute(typeof(System.ComponentModel.Design.CollectionEditor), typeof(System.Drawing.Design.UITypeEditor))] public List<SomeType> Textures { get { return m_collection; } set { m_collection = value; } } However, when I try to edit this collection with the CollectionEditor , set is never called; why is this and how can I fix it? I also tried to wrap my List<SomeType> in my own

List<int> designer serialization

99封情书 提交于 2019-12-08 07:17:24
问题 Why MyIntList property below correctly interprets the DesignerSerializationVisibility.Content producing the following output in the designer: this.myControl1.MyIntList.Add(1); this.myControl1.MyIntList.Add(2); this.myControl1.MyIntList.Add(3); while MyClassIntList one outputs the following? this.myButton1.MyClassIntList = new MyClass(((System.Collections.Generic.List<int>)(resources.GetObject("myControl1.MyClassIntList")))); Here is custom control class source code: [Serializable] public

Is there any way to use a CollectionEditor outside of the property grid?

邮差的信 提交于 2019-12-05 04:17:13
问题 I'm replacing my property grid with something that will allow me to customize my UI a bit better. I placed a button on my form that I hope when clicked would pop up a CollectionEditor and allow me to modify my code. When I was using the PropertyGrid, all I needed to do was add some attributes to the property pointing to my CollectionEditor and it worked. But how do I invoke the CollectionEditor manually? Thanks! 回答1: Found the answer here: http://www.devnewsgroups.net/windowsforms/t11948

CollectionEditor yielding “Object does not match target type.” for System.Drawing.Point

不羁岁月 提交于 2019-12-03 12:59:39
I have a custom control which has a property of type Collection<System.Drawing.Point> . When I use CollectionEditor to edit this property, the CollectionEditor window shows "Object does not match target type." for the "X" and "Y" properties. But if I use System.Drawing.PointF instead, there's no failure. Can anyone please explain why this difference occurs? kicsit The difference between Point and PointF lies indeed with PointConverter. Why this causes a problem is quite a long story, but at the end of the day it boils down to the following: The System.ComponentModel.ICustomTypeDescriptor

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