mylabel.vb

来自「This is a book about vb.you could learn 」· VB 代码 · 共 45 行

VB
45
字号
Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls

Namespace WroxControls 

  Public Class MyLabel2

	  Inherits WebControl

		Public Sub New()
			MyBase.New("h1")
		End Sub


		dim _text as String

		Public Property Text as String

			Get
				Text = _text
			End Get

			Set
				_text = Value
			End Set

		End Property

		Overrides Protected Sub OnInit(e as EventArgs)

			if ( _text is Nothing ) then
	             _text = "Here is some default text"
			end if

		End Sub

	    Overrides Protected Sub RenderContents(writer as HtmlTextWriter) 
	      writer.Write( _text )
	    End Sub

  End Class

End Namespace 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?