PDA

Click to See Complete Forum and Search --> : ugent help


Mark_Meng
Apr 20th, 2001, 04:20 PM
Can someone explain why the code below does not work. I create a user control and type something in the datafield at property window. But it will disappear after I run the app. Can somebody help? Thanks very much

private m_DataField as string
Public Property Let DataField(vDatafield As String)
m_DataField = vDatafield
PropertyChanged "DataField"
End Property
Public Property Get DataField() As String
DataField = m_DataField
End Property
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
fpblnYes.DataField = PropBag.ReadProperty("DataField", DataField)
End Sub

Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("DataField", m_DataField, DataField)
End Sub

rafaelc
May 7th, 2001, 03:37 PM
If you are trying to make an object persist...
I think you are missing a couple of steps....

You have to create the Property Bag object and write the object to the
Property Bag... then those events will get trigered.

After that, the client application must write the contents of the
Property Bag to a file... thats the write processes ... the read process is similar but backwards.

Go to MSDN online and lookup the... "Property Bag" Object... look at its Content property...

The code you've provided is incomplete