L
Leo
I am building a custom control, code at bottom, and after I place it on a
web page I would like to see the Title property in the properties window
when the control is selected at design time. How do I accomplish this?
Imports System.ComponentModel
<Description("Top of Web page"), Browsable(True), DefaultValue("Title")> _
Public Class Header
Inherits System.Web.UI.UserControl
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
End Sub
Protected WithEvents lblTitle As System.Web.UI.WebControls.Label
Protected WithEvents hypHome As System.Web.UI.WebControls.HyperLink
Protected WithEvents lblPath As System.Web.UI.WebControls.Label
Protected WithEvents lblUser As System.Web.UI.WebControls.Label
'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
<Browsable(True), DefaultValue("Title"), Description("The title of the
page"), Category("Appearance")> _
Public Property Title() As String
Get
Return lblTitle.Text
End Get
Set(ByVal Value As String)
lblTitle.Text = Value
End Set
End Property
<Browsable(True), DefaultValue(""), Description("The logged on name")> _
Public WriteOnly Property User() As String
Set(ByVal Value As String)
lblUser.Text = Value
End Set
End Property
<Browsable(True), DefaultValue(""), Description("The path in the website
of the page")> _
Public WriteOnly Property Path() As String
Set(ByVal Value As String)
lblPath.Text = Value
End Set
End Property
<Browsable(True), DefaultValue(""), Description("A hyperlink to the
page")> _
Public WriteOnly Property Home() As String
Set(ByVal Value As String)
hypHome.Text = Value
End Set
End Property
End Class
web page I would like to see the Title property in the properties window
when the control is selected at design time. How do I accomplish this?
Imports System.ComponentModel
<Description("Top of Web page"), Browsable(True), DefaultValue("Title")> _
Public Class Header
Inherits System.Web.UI.UserControl
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
End Sub
Protected WithEvents lblTitle As System.Web.UI.WebControls.Label
Protected WithEvents hypHome As System.Web.UI.WebControls.HyperLink
Protected WithEvents lblPath As System.Web.UI.WebControls.Label
Protected WithEvents lblUser As System.Web.UI.WebControls.Label
'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
<Browsable(True), DefaultValue("Title"), Description("The title of the
page"), Category("Appearance")> _
Public Property Title() As String
Get
Return lblTitle.Text
End Get
Set(ByVal Value As String)
lblTitle.Text = Value
End Set
End Property
<Browsable(True), DefaultValue(""), Description("The logged on name")> _
Public WriteOnly Property User() As String
Set(ByVal Value As String)
lblUser.Text = Value
End Set
End Property
<Browsable(True), DefaultValue(""), Description("The path in the website
of the page")> _
Public WriteOnly Property Path() As String
Set(ByVal Value As String)
lblPath.Text = Value
End Set
End Property
<Browsable(True), DefaultValue(""), Description("A hyperlink to the
page")> _
Public WriteOnly Property Home() As String
Set(ByVal Value As String)
hypHome.Text = Value
End Set
End Property
End Class