请教一段代码,不明什么意思。帮忙解释一下
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
' Read saved property values
On Error Resume Next
Set UserControl.Font = PropBag.ReadProperty("Font", UserControl.Ambient.Font)
Caption = PropBag.ReadProperty("Caption", UserControl.Ambient.DisplayName)
Enabled = PropBag.ReadProperty("Enabled", True)
TextColor = PropBag.ReadProperty("TextColor", vbButtonText)
HoverColor = PropBag.ReadProperty("HoverColor", vbHighlight)
BackColor = PropBag.ReadProperty("BackColor", vbButtonFace)
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
' Save design-time property values
On Error Resume Next
PropBag.WriteProperty "Font", UserControl.Font, UserControl.Ambient.Font
PropBag.WriteProperty "Caption", mCaption, UserControl.Ambient.DisplayName
PropBag.WriteProperty "Enabled", mEnabled, True
PropBag.WriteProperty "TextColor", mTextColor, vbButtonText
PropBag.WriteProperty "HoverColor", mHoverColor, vbHighlight
PropBag.WriteProperty "BackColor", UserControl.BackColor, vbButtonFace
End Sub