o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

UserControl don't save properties... URGENT! -

found this code somewhere on the web, and it works only in Design Mode. when you play it, the font property return to it's default value.

Code:
Dim WithEvents mFont As StdFont

Private Sub UserControl_Initialize()
   Set mFont = New StdFont
   Set UserControl.Font = mFont
End Sub

Public Property Get Font() As StdFont
   Set Font = mFont
End Property

Public Property Set Font(mNewFont As StdFont)
   With mFont
      .Bold = mNewFont.Bold
      .Italic = mNewFont.Italic
      .Name = mNewFont.Name
      .Size = mNewFont.Size
   End With
   
   PropertyChanged "Font"
End Property

Private Sub mFont_FontChanged(ByVal PropertyName As String)
   Set UserControl.Font = mFont
   Refresh
End Sub

Whats worng?

 


Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/genitalh/okquestions.com/relquery.php on line 79