Adding a Designer attribute to a control class (VB) : Designer attribute « Custom Controls « ASP.NET Tutorial






Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.Design
Imports System.ComponentModel.Design

<DefaultProperty("Text")> _
<ToolboxData("<{0}:[WebCustomControl1] runat=server></{0}:[WebCustomControl1]>")> _
<Designer(GetType(ControlDesigner))> _
Public Class [WebCustomControl1]
    Inherits System.Web.UI.WebControls.WebControl

    Dim _text As String

    <Bindable(True), Category("Appearance"), DefaultValue("")> _
    Property [Text]() As String
        Get
            Return _text
        End Get

        Set(ByVal Value As String)
            _text = Value
        End Set
    End Property

    Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter)
        output.RenderBeginTag(HtmlTextWriterTag.Input)
        output.RenderEndTag()
    End Sub

End Class








14.7.Designer attribute
14.7.1.Adding a Designer attribute to a control class (C#)
14.7.2.Adding a Designer attribute to a control class (VB)