customcontrol1.vb

来自「asp入门到精通的源代码」· VB 代码 · 共 24 行

VB
24
字号
Imports System
Imports System.Web
Imports System.Web.UI

Namespace MyCustomControls
   Public Class CustomControl1 : Inherits Control
      private strMessage as string = "This is my custom control!"
      public property Message as string
         Get
            Message = strMessage
         End Get
         Set
            strMessage = value
         End Set
      end property

      Protected Overrides Sub Render(Output as HtmlTextWriter)
         Output.Write(strMessage & " The time is now " & _
            DateTime.Now.ToString)
      End Sub
   End Class

End Namespace

⌨️ 快捷键说明

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