Adding items to property window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris

    #1

    Adding items to property window


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

    Public Class FormatedTextbox
    Inherits Windows.Forms.T extBox

    Dim m_SelectedBackC olor As Color
    Dim m_OrigBackColor As Color

    Public Property SelectedBackCol or() As Color
    Get
    Return m_SelectedBackC olor
    End Get
    Set(ByVal Value As Color)
    m_SelectedBackC olor = Value
    End Set
    End Property

    Protected Overrides Sub OnGotFocus(ByVa l e As System.EventArg s)
    m_OrigBackColor = Me.BackColor
    Me.BackColor = m_SelectedBackC olor
    End Sub

    Protected Overrides Sub OnLostFocus(ByV al e As System.EventArg s)
    Me.BackColor = m_OrigBackColor
    End Sub
    End Class
  • Crouchie1998

    #2
    Re: Adding items to property window

    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


    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Adding items to property window

      "Crouchie19 98" <crouchie1998@s pamcop.net> schrieb:[color=blue]
      > Off the top of my head
      >
      > Try the <Browsable(True )> _
      > attribute above the property. Its in System.Runtime. Interop class[/color]

      I think that you wanted to type "'System.Compon entModel' namespace".

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://classicvb.org/petition/>

      Comment

      Working...