|
我做的控件由一个lable(名称为lblCaption)与一个timer组成,我用以下代码设置了控件的font属性:
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
但是Font属性无法在属性窗口显示出来,请问是什么原因?
整个代码可在这个地址下载:
http://www.vbgood.com/attachment.php?aid=5164
谢谢!!
|
|