当前位置: 首页>>代码示例>>VB.NET>>正文


VB.NET ContainerControlDesigner类代码示例

本文整理汇总了VB.NET中System.Web.UI.Design.ContainerControlDesigner的典型用法代码示例。如果您正苦于以下问题:VB.NET ContainerControlDesigner类的具体用法?VB.NET ContainerControlDesigner怎么用?VB.NET ContainerControlDesigner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ContainerControlDesigner类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。

示例1: ParseChildren

' 导入命名空间
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Collections
Imports System.Drawing
Imports System.Web.UI
Imports System.Web.UI.Design
Imports System.Web.UI.Design.WebControls
Imports System.Web.UI.WebControls

Namespace ControlDesignerSamples.VB


    ' Define a simple composite control, derived from the 
    ' System.Web.UI.WebControls.CompositeControl class.

    <Designer(GetType(SimpleContainerControlDesigner)), _
     ParseChildren(False)> _
    Public Class SimpleContainerControl
        Inherits CompositeControl

    End Class


    ' Define the designer for the simple composite control.
    ' The designer derives from System.Web.UI.Design.ContainerControlDesigner.
    ' The designer defines the style and caption for the frame around the 
    ' editable region of the control in the design surface.
    Public Class SimpleContainerControlDesigner
        Inherits ContainerControlDesigner

        Private _style As Style = Nothing

        ' Define the caption text for the frame in the design surface.
        Public Overrides ReadOnly Property FrameCaption() As String
            Get
                Return "- My simple container control -"
            End Get
        End Property


        ' Define the style of the frame around the control in the design surface.
        Public Overrides ReadOnly Property FrameStyle() As Style
            Get
                If _style Is Nothing Then

                    _style = New Style()
                    _style.Font.Name = "Verdana"
                    _style.Font.Size = New FontUnit("XSmall")
                    _style.BackColor = Color.LavenderBlush
                    _style.ForeColor = Color.DarkBlue
                End If

                Return _style
            End Get
        End Property


    End Class

End Namespace
开发者ID:VB.NET开发者,项目名称:System.Web.UI.Design,代码行数:61,代码来源:ContainerControlDesigner


注:本文中的System.Web.UI.Design.ContainerControlDesigner类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。