|
The control I made consists of a lable (named lblCaption) and a timer.I set the control's font property with the following code:
Private mfonFont As StdFont
Public Property Get Font () As StdFont
'the value for the control's font property is "stored" in the lblcaption object's font property
Set Font = lblCaption.Font
End Property
Public Property Set Font (ByVal NewValue As Variant)
'store the control's new font value in the lblcaption object's font property
Set lblCaption.Font = NewValue
UserControl.PropertyChanged "Font"
End Property
Private Sub UserControl_WriteProperties (PropBag As PropertyBag)
PropBag.WriteProperty "Font", Font, mfonFont
End Sub
Private Sub UserControl_ReadProperties (PropBag As PropertyBag)
Set Font = PropBag.ReadProperty ("Font", mfonFont)
End Sub
However, the Font property cannot be displayed in the property window. What is the reason?
The entire code can be downloaded at this address:
http://www.vbgood.com/attachment.php?aid=5164
Thank you!! |
|