C
Carlo
Hi all,
In my Form1, I have this statement:
Me.EnhancedPanelGreen2.Background.Color =
System.Drawing.Color.GreenYellow
This is normal, because I've set to GreenYellow the Color property of the
class Background in the component EnhancedPanelGreen2.
Now, the following is the part of code of the class Background inside
EnhancedPanelGreen2 component that controls the serialization:
Public Property Color() As Color
Get
Return mColor
End Get
Set(ByVal value As Color)
mColor = value
End Set
End Property
' <Serialization>
Protected Sub ResetColor()
Color = Color.Green
End Sub
Protected Function ShouldSerializeColor() As Boolean
Return Not Color.Equals(Color.Green)
End Function
The problem is that changing Color to Green (that is the default of Color
property) in the property browser of Form1, the statement inside my Form1 IS
STILL:
Me.EnhancedPanelGreen2.Background.Color =
System.Drawing.Color.GreenYellow
What I need (and what I expected) is that the above statement will
disappears because the color (Green) is equal to the default(Green). Could
someone try to explain me what I'm missing?
Thank you very much
Carlo
In my Form1, I have this statement:
Me.EnhancedPanelGreen2.Background.Color =
System.Drawing.Color.GreenYellow
This is normal, because I've set to GreenYellow the Color property of the
class Background in the component EnhancedPanelGreen2.
Now, the following is the part of code of the class Background inside
EnhancedPanelGreen2 component that controls the serialization:
Public Property Color() As Color
Get
Return mColor
End Get
Set(ByVal value As Color)
mColor = value
End Set
End Property
' <Serialization>
Protected Sub ResetColor()
Color = Color.Green
End Sub
Protected Function ShouldSerializeColor() As Boolean
Return Not Color.Equals(Color.Green)
End Function
The problem is that changing Color to Green (that is the default of Color
property) in the property browser of Form1, the statement inside my Form1 IS
STILL:
Me.EnhancedPanelGreen2.Background.Color =
System.Drawing.Color.GreenYellow
What I need (and what I expected) is that the above statement will
disappears because the color (Green) is equal to the default(Green). Could
someone try to explain me what I'm missing?
Thank you very much
Carlo