Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am sorry if this is a stupid question, but I am new to expandable properties.

When I change the value of TextAlpha I would like the clsButton to get informed and update the m_AlphaText variable.
How do I do that?

In advance thank you,
Henrik
VB
Public Class clsButton
    Inherits Button

    Private m_Text As New TextProperties
    Private m_AlphaText As Integer = 100

    <CategoryAttribute("Design"), _
RefreshProperties(RefreshProperties.All), _
DisplayName("Text Properties"), _
Description("All text properties")> _
    Public Property TextProp() As TextProperties
        Get
            Return m_Text
        End Get
        Set(ByVal value As TextProperties)
            m_Text = value
        End Set
    End Property
End Class


    <TypeConverter(GetType(ExpandableObjectConverter))> _
Public Class TextProperties
    Private m_AlphaText As Integer = 100
 
    <DesignerSerializationVisibility(DesignerSerializationVisibility.Content), _
    Browsable(True), NotifyParentProperty(True),
    EditorBrowsable(EditorBrowsableState.Always)>
    Public Property TextAlpha() As Integer
        Get
            Return m_AlphaText
        End Get
        Set(ByVal value As Integer)
            If value < 256 And value > -1 Then
                m_AlphaText = value
            Else
                MsgBox("Min. alpha is 0 and max. alpha is 255")
                m_AlphaText = 100
            End If
        End Set
    End Property
End Class
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900