customcontrol2.vb

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

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

Namespace MyCustomControls
   Public Class CustomControl2 : Inherits Control
      public property Message as string
         Get
            Message = ViewState("Message").ToString
         End Get
         Set
            ViewState("Message") = value
         End Set
      end property
      
      public property Size as integer
         Get
            Size = CType(ViewState("Size"), Integer)
         End Get
         Set
            ViewState("Size") = value
         End Set
      end property

      Protected Overrides Sub Render(Output as HtmlTextWriter)
         Output.Write("<font size=" & Me.Size & ">" & Me.Message & "</font>")
      End Sub
   End Class

End Namespace

⌨️ 快捷键说明

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