Adding items to property window

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I have this custom class. When I select it in the designer, I can't get
the property "SelectedBackColor" to show up. Any help? Thanks
Chris

Public Class FormatedTextbox
Inherits Windows.Forms.TextBox

Dim m_SelectedBackColor As Color
Dim m_OrigBackColor As Color

Public Property SelectedBackColor() As Color
Get
Return m_SelectedBackColor
End Get
Set(ByVal Value As Color)
m_SelectedBackColor = Value
End Set
End Property

Protected Overrides Sub OnGotFocus(ByVal e As System.EventArgs)
m_OrigBackColor = Me.BackColor
Me.BackColor = m_SelectedBackColor
End Sub

Protected Overrides Sub OnLostFocus(ByVal e As System.EventArgs)
Me.BackColor = m_OrigBackColor
End Sub
End Class
 
Off the top of my head

Try the <Browsable(True)> _
attribute above the property. Its in System.Runtime.Interop class

This will work for a control, but not for a class added to the project. That
will only show up when using the property in code

Crouchie1998
BA (HONS) MCP MCSE
 
Crouchie1998 said:
Off the top of my head

Try the <Browsable(True)> _
attribute above the property. Its in System.Runtime.Interop class

I think that you wanted to type "'System.ComponentModel' namespace".
 
Back
Top