Adding a property to a user control in VB6 requires 4 subroutines to be filled, the Let/Set, Get and property Bags respectively.
Let and get have the variant as return type as an argument, which means any value can be accessed through the property.
Public Property Get Interval() As Variant
Interval = Timer1.Interval
End Property
Public Property Let Interval(ByVal vNewValue As Variant)
Timer1.Interval = vNewValue
PropertyChanged “Interval”
End Property
Suppose you want to change how do you get the Font Dialog within the Property Window. This can be possible with use of stdfont in place of Variant as follows
Public Property Set Font(ByVal Nfont As StdFont)
Set lbl_Time.Font = Nfont
Refresh
PropertyChanged “Font”
End Property
Public Property Get Font() As StdFont
Set Font = UserControl.lbl_Time.Font
End Property
The complete VB6 Stopwatch Project can be accessible in my GitHub repository