Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PropertyBag Problem?
Message
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Titre:
PropertyBag Problem?
Divers
Thread ID:
00783792
Message ID:
00783792
Vues:
51
I created an ActiveX control, with a property called Enabled. There is a
label on the control which I want to turn dark grey when the enabled
property is set to False.

The enabled property does not persist from design time into
run time. Here's the code:
Private Const DEF_ENABLED = True
Private bEnabled As Boolean

Private Sub UserControl_Initialize()

  bEnabled = DEF_ENABLED

End Sub

Public Property Get Enabled() As Boolean

  Enabled = bEnabled

End Property

Public Property Let Enabled(ByVal bNewValue As Boolean)

  bEnabled = bNewValue

  If bNewValue Then
    lblCaption.ForeColor = &H80000012
  Else
    lblCaption.ForeColor = &H80000011
  End If

End Property

Private Sub UserControl_ReadProperties(PropBag As PropertyBag)

    bEnabled = PropBag.ReadProperty("Enabled", DEF_ENABLED)

    If bEnabled Then
      lblCaption.ForeColor = &H80000012
    Else
      lblCaption.ForeColor = &H80000011
    End If

End Sub

Private Sub UserControl_WriteProperties(PropBag As PropertyBag)

    Call PropBag.WriteProperty("Enabled", bEnabled, DEF_ENABLED)

End Sub
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform