为什么属性值不能保存?
为什么属性值不能保存?下面是我在设计控件时的原代码,出错的现象是在设计时改变slwok属性的值不能保存,在控件重新加载后旧的设置值丢失,例如在设计时将slwok的值设为true,重新加载控件后,控件slwok属性的值不能保留为原来的值true,而变为false。请帮我看看错在哪里?怎样才能使属性值得以保存?
Dim slwoks As Boolean '决定列宽是否可拖动
Public Property Get slwok() As Boolean
slwok = slwoks
End Property
Public Property Let slwok(newd As Boolean)
slwoks = newd
PropertyChanged "slwok"
End Property
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "slwok", slwok, True
End Sub
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
PropBag.ReadProperty "slwok", True
End Sub