Use property in custom control

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I am creating a custom control and I have the following property:
<Bindable(True), Category("Appearance"), DefaultValue(""),
Localizable(True)> Property Text() As String
Get
Dim s As String = CStr(ViewState("Text"))
If s Is Nothing Then
Return String.Empty
Else
Return s
End If
End Get

Set(ByVal Value As String)
ViewState("Text") = Value
End Set

End Property

I created a ChildControl as follows:
Protected Overrides Sub CreateChildControls()

' Create child controls
Dim lMessage As New Label

' Define lMessage properties
With lMessage
.Text = ???????????????????
.ID = "lMessage"
End With

End Sub
----------------------------

How do I set lMessage.Text = Text property value?

Thanks,
Miguel
 
Back
Top