Hello, I am designing a control in which the user selects a property that opens an editor. In the editor, a selection is made from a listbox, and an object (an instance of a class that contains 3 strings) is returned to the property. The problem is that when the property is set, it is not setting the runtime intializer on the parent form. I have read some documentation and and tried both using a type converter and overriding the canconvert and convertto methods, and have also tried different combinations of the designerSerializationVisiblity attribute on the property itself. All I want is for the run-time intializer to give me an new instance of my object with the properties that are set in design time. Does anyone have experience with this. Any help would be appreciated.
Sample Intialization Code
mycomponent.myproperty = New Class("ABC", "PDF", "XYZ")
Sample Property
Public Property MyProperty as MyCustomClass
Get
return instanceofmycustomclass
End Get
Set(byVal Value as MyCustomClass)
instanceofmycusomclass = value
End Set
End Property
Palo Mraz - 27 Apr 2004 13:50 GMT
Tim,
If I understand it right, you've to implement a TypeConverter, which can
convert your custom class to an InstanceDescriptor...see
http://msdn.microsoft.com/library/en-us/dndotnet/html/custcodegen.asp?frame=true
Palo
---
http://dact.lamarvin.com/
AutoComplete component for WinForms applications.
Easy to integrate, easier to use!
http://www.vbinfozine.com/
An ordinary VB developer shares his own successes
and failures