Adding items to property window

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
 
C

Crouchie1998

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
 
H

Herfried K. Wagner [MVP]

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".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top