Custom property on form not persisting value in VS 2005
- From: "j.edwards" <j.edwards__NOSPAM__._.__._@xxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 11 Jan 2006 12:43:30 +1100
I posted before about collections but have since tried on a simple single
class and it's not working either. I'm using VB.NET but I thought it now had
the same designtime capabilities as C#.
Here's what I've done...
- New application (CF2)
- New class library in same solution
in the class library...
- make up a new class - just with two simple string properties, e.g.
Public Class Item
Private _Title As String
Property Title() As String
Get
Return _Title
End Get
Set(ByVal value As String)
_Title = value
End Set
End Property
Private _Value As String
Property Value() As String
Get
Return _Value
End Get
Set(ByVal value As String)
_Value = value
End Set
End Property
End Class
- I add a form to the class library and put a property on it of type "Item"
as per above class.
- Then I go into class diagram to add the designer stuff...
- On the form class I've got:
Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()
DesignTimeVisible(true)
DesktopCompatible(true)
- On the property of the form I've made up:
TypeConverter(" System.ComponentModel.ExpandableObjectConverter, System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ")
Category("_Test")
Description("Test")
DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)
Browsable(true)
- On the Item class:
DesignTimeVisible(true)
DesktopCompatible(true)
- NOTE: I haven't added any design time stuff to the properties of the Item
class (e.g. "Title", "Value")
In the application I then add a form inheriting from the one in the class
library and in the designer I can see the property, and even change the
values - but when I close the form and re-open it the values are gone. It's
not writing anything to the InitializeComponent() section.
One other question - why can't I see the property in the designer when I
view the "base form" - the one in the class library? why does the "Item"
property only show on inheriting forms?
Any help would be appreciated. Thanks.
.
- Follow-Ups:
- Re: Custom property on form not persisting value in VS 2005
- From: j.edwards
- Re: Custom property on form not persisting value in VS 2005
- Prev by Date: Re: CF app running but not executing
- Next by Date: Re: Scanner
- Previous by thread: the remote connection to the device has been lost
- Next by thread: Re: Custom property on form not persisting value in VS 2005
- Index(es):
Relevant Pages
|