Public Form property not shown in Property editor


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I have a couple of properties, both of type Color, that I added to a form. They are public properties, I've set up a Category() and Description() and added ShouldSerialize/Reset methods for them. However, I can't get them to show up in the property editor (grid). I would have sworn that there wasn't anything special to get this to work, but I'm baffled. Any ideas what I could be doing wrong?



Here's the code:



Private _passingBackColor As Color = Color.LightGreen



''' <summary>

''' Define the color used to highlight items that have passing

''' scores.

''' </summary>

<Category("RAMS: Score Formatting") _

, Description("Define the color used to highlight passing scores in the list.")> _

Public Property PassingBackColor() As Color

Get

Return _passingBackColor

End Get

Set(ByVal value As Color)

_passingBackColor = value

End Set

End Property



Private _failingBackColor As Color = Color.LightPink



''' <summary>

''' Define the color used to highlight items that have failing

''' scores.

''' </summary>

<Category("RAMS: Score Formatting") _

, Description("Define the color used to highlight failing scores in the list.")> _

Public Property FailingBackColor() As Color

Get

Return _failingBackColor

End Get

Set(ByVal value As Color)

_failingBackColor = value

End Set

End Property



''' <summary>

''' Return if the designer should serialize the PassingBackColor

''' property.

''' </summary>

''' <returns>True if property needs to be serialized to the designer</returns>

''' <remarks></remarks>

Public Function ShouldSerializePassingBackColor() As Boolean

Return _passingBackColor <> Color.LightGreen

End Function



''' <summary>

''' Reset the PassingBackColor to its default value and remove serialization

''' the property from the designer.

''' </summary>

''' <remarks></remarks>

Public Sub ResetPassingBackColor()

_passingBackColor = Color.LightGreen

End Sub



''' <summary>

''' Return if the designer should serialize the FailingBackColor

''' property.

''' </summary>

''' <returns>True if property needs to be serialized to the designer</returns>

''' <remarks></remarks>

Public Function ShouldSerializeFailingBackColor() As Boolean

Return _failingBackColor = Color.LightPink

End Function



''' <summary>

''' Reset the FailingBackColor to its default value and remove serialization

''' the property from the designer.

''' </summary>

''' <remarks></remarks>

Public Sub ResetFailingBackColor()

_failingBackColor = Color.LightPink

End Sub

Reply
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hey Greg.

Not sure this is the cause, but I define the DescriptionAttribute, not the Description, as you are coding over there:

''' <summary>
''' Define the color used to highlight items that have passing
''' scores.
''' </summary>
<Category("RAMS: Score Formatting") _
  , DescriptionAttribute("Define the color used to highlight passing scores in the list.")> _
Public Property PassingBackColor() As Color
    Get
        Return _passingBackColor
    End Get
    Set(ByVal value As Color)
        _passingBackColor = value
    End Set
End Property


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Greg McGuffey - 17 Years Ago
Ivan George Borges - 17 Years Ago
Keith Chisarik - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Greg McGuffey - 17 Years Ago
                     You got it ;)
Trent L. Taylor - 17 Years Ago
                         Thanks! Mystery solved! :w00t:
Greg McGuffey - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search