wroxstylerdesigner.vb

来自「ASP.NET服务器控件高级编程电子书」· VB 代码 · 共 43 行

VB
43
字号
Imports System
Imports System.IO
Imports System.Web.UI
Imports System.Web.UI.Design
Imports System.Web.UI.WebControls
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports WroxDesignVB

Namespace WroxDesignVB.Design

    Public Class WroxStylerDesigner : Inherits ControlDesigner

        Public Sub New()
        End Sub

        Public Overrides Function GetDesignTimeHtml() As String

            Dim st As WroxStyler = CType(MyBase.Component, WroxStyler)

            If (st.RelatedButtonID <> String.Empty) Then
                Dim svc As IReferenceService = _
                    CType(GetService(GetType(IReferenceService)), IReferenceService)

                Dim button As WroxButton = CType(svc.GetReference(st.RelatedButtonID), WroxButton)
                'Was the button found?
                If Not (button Is Nothing) Then
                    st.CopyBaseAttributes(button)
                    st.Font.CopyFrom(button.Font)
                    st.BackColor = button.BackColor
                    st.BorderColor = button.BorderColor
                    st.BorderStyle = button.BorderStyle
                    st.BorderWidth = button.BorderWidth
                    st.ForeColor = button.ForeColor
                End If
            End If
            Return MyBase.GetDesignTimeHtml()
        End Function

    End Class
End Namespace

⌨️ 快捷键说明

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