⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clsadvancededit.cls

📁 一款Grid表格控件源代码,非常棒.不下你一定会后悔
💻 CLS
📖 第 1 页 / 共 3 页
字号:
            .ComboIndexColor = m_lBackColor
        Else
            If Not (.ListIndex = -1) Then
                m_lBackColor = CLng(.ListText(.ListIndex))
            End If
        End If
    End With

End Sub

Private Sub m_cCbFontColor_ItemChange(ByVal lItem As Long)
'/* forecolor change

    With m_cCbFontColor
        If (.ListIndex = 0) Then
            '/* open color dialog
            m_lForeColor = ComboExtendedColors
            .ComboIndexColor = m_lForeColor
        Else
            If Not (.ListIndex = -1) Then
                m_lForeColor = CLng(.ListText(.ListIndex))
            End If
        End If
    End With

End Sub

Public Property Get HostHwnd() As Long
    HostHwnd = m_lHostHwnd
End Property

Public Property Let HostHwnd(ByVal PropVal As Long)
    m_lHostHwnd = PropVal
End Property

Public Property Get Width() As Long
    Width = m_lWidth
End Property

Public Property Let Width(ByVal PropVal As Long)
    m_lWidth = PropVal
End Property

Public Property Get Height() As Long
    Height = m_lHeight
End Property

Public Property Let Height(ByVal PropVal As Long)
    m_lHeight = PropVal
End Property

Public Sub CreateEditBox(ByVal lOwnerHwnd As Long, _
                         ByVal lX As Long, _
                         ByVal lY As Long, _
                         ByVal eThemeStyle As ECAThemeStyle, _
                         Optional ByVal lThemeColor As Long = -1, _
                         Optional ByVal lThemeOffsetColor As Long = -1, _
                         Optional ByVal sText As String, _
                         Optional ByVal lImlHwnd As Long = -1, _
                         Optional ByVal lIcnIndex As Long = -1, _
                         Optional eImageType As EIAImageType)

'/* create edit window

    If Not (lOwnerHwnd = 0) Then
        m_lParentHwnd = lOwnerHwnd
        '/* create host window
        CreateWindow
        '/* subclass
        Attach
        With m_tRWnd
            .Left = lX
            .Right = 362
            .Top = lY
            .bottom = 282
        End With
        '/* show
        SetPosition m_lHostHwnd, m_tRWnd
        '/* store image data
        If (lImlHwnd > -1) Then
            m_lImlHwnd = lImlHwnd
            m_eImageType = eImageType
            m_lIconIndex = lIcnIndex
        End If
        m_lThemeColor = lThemeColor
        m_lOffsetColor = lThemeOffsetColor
        m_sEditText = sText
        m_eThemeStyle = eThemeStyle
        '/* create support controls
        CreateControls lImlHwnd, lIcnIndex
    End If
    
End Sub

Private Sub CreateControls(ByVal lImlHwnd As Long, _
                           Optional ByVal lIcnIndex As Long = -1)

'/* create support controls

Dim oFont As StdFont

    Set m_cTxEditBox = New clsODControl
    With m_cTxEditBox
        '/* control name
        .Name = "txtEdit"
        '/* borderstyle
        .BorderStyle ecbsThin
        '/* create control window
        .Create m_lHostHwnd, 9, 6, 337, 118, ecsTextBox
        '/* add text
        .Text = m_sEditText
    End With
    
    Set m_cLbFontColor = New clsODControl
    With m_cLbFontColor
        .Name = "lblColor"
        .BorderStyle ecbsNone
        .AutoBackColor = True
        .Create m_lHostHwnd, 9, 129, 44, 13, ecsLabel
        .Text = "ForeColor"
        .AutoSize = True
    End With
    
    Set m_cCbFontColor = New clsODControl
    With m_cCbFontColor
        .Name = "cbForeColor"
        .BorderStyle ecbsThin
        .ThemeStyle = m_eThemeStyle
        If (m_lThemeColor > -1) Then
            .ThemeColor = m_lThemeColor
        End If
        If (m_lOffsetColor > -1) Then
            .HiliteColor = m_lOffsetColor
        End If
        .Create m_lHostHwnd, 9, 141, 160, 120, ecsImageCombo
        .AddItem "More.."
    End With
    
    Set m_cLbFontSelect = New clsODControl
    With m_cLbFontSelect
        .Name = "lblCellfont"
        .BorderStyle ecbsNone
        .AutoBackColor = True
        .Create m_lHostHwnd, 9, 170, 41, 13, ecsLabel
        .Text = "Cell Font"
        .AutoSize = True
    End With
    
    Set m_cCbFontSelect = New clsODControl
    With m_cCbFontSelect
        .Name = "cbFontSelect"
        .BorderStyle ecbsThin
        .ThemeStyle = m_eThemeStyle
        If (m_lThemeColor > -1) Then
            .ThemeColor = m_lThemeColor
        End If
        If (m_lOffsetColor > -1) Then
            .HiliteColor = m_lOffsetColor
        End If
        .Create m_lHostHwnd, 9, 182, 160, 120, ecsImageCombo
        .AddItem "More.."
    End With
    
    Set m_cBtFontBold = New clsODControl
    With m_cBtFontBold
        .Name = "cmdBold"
        .HiliteColor = &HCCCCCC
        Set oFont = New StdFont
        With oFont
            .Name = "ARIAL"
            .Size = 8
            .Bold = True
        End With
        Set .Font = oFont
        .CommandPushButton = True
        .ThemeStyle = m_eThemeStyle
        If (m_lThemeColor > -1) Then
            .ThemeColor = m_lThemeColor
        End If
        If (m_lOffsetColor > -1) Then
            .HiliteColor = m_lOffsetColor
        End If
        .Create m_lHostHwnd, 9, 212, 22, 22, ecsCommandButton
        .Text = "B"
        Set oFont = Nothing
    End With
    
    Set m_cBtFontItalic = New clsODControl
    With m_cBtFontItalic
        .Name = "cmdItalic"
        .HiliteColor = &HCCCCCC
        Set oFont = New StdFont
        With oFont
            .Name = "ARIAL"
            .Size = 8
            .Bold = True
            .Italic = True
        End With
        Set .Font = oFont
        .CommandPushButton = True
        .ThemeStyle = m_eThemeStyle
        If (m_lThemeColor > -1) Then
            .ThemeColor = m_lThemeColor
        End If
        If (m_lOffsetColor > -1) Then
            .HiliteColor = m_lOffsetColor
        End If
        .Create m_lHostHwnd, 35, 212, 22, 22, ecsCommandButton
        .Text = "I"
        Set oFont = Nothing
    End With
    
    Set m_cBtFontStrike = New clsODControl
    With m_cBtFontStrike
        .Name = "cmdStrike"
        .HiliteColor = &HCCCCCC
        Set oFont = New StdFont
        With oFont
            .Name = "ARIAL"
            .Size = 8
            .Bold = True
            .Strikethrough = True
        End With
        Set .Font = oFont
        .CommandPushButton = True
        .ThemeStyle = m_eThemeStyle
        If (m_lThemeColor > -1) Then
            .ThemeColor = m_lThemeColor
        End If
        If (m_lOffsetColor > -1) Then
            .HiliteColor = m_lOffsetColor
        End If
        .Create m_lHostHwnd, 61, 212, 22, 22, ecsCommandButton
        .Text = "S"
        Set oFont = Nothing
    End With
    
    Set m_cBtFontUnderline = New clsODControl
    With m_cBtFontUnderline
        .Name = "cmdUnderline"
        .HiliteColor = &HCCCCCC
        Set oFont = New StdFont
        With oFont
            .Name = "ARIAL"
            .Size = 8
            .Bold = True
            .Underline = True
        End With
        Set .Font = oFont
        .CommandPushButton = True
        .ThemeStyle = m_eThemeStyle
        If (m_lThemeColor > -1) Then
            .ThemeColor = m_lThemeColor
        End If
        If (m_lOffsetColor > -1) Then
            .HiliteColor = m_lOffsetColor
        End If
        .Create m_lHostHwnd, 87, 212, 22, 22, ecsCommandButton
        .Text = "U"
        Set oFont = Nothing
    End With

    Set m_cLbSize = New clsODControl
        With m_cLbSize
        .Name = "lblSize"
        .BorderStyle ecbsNone
        .AutoBackColor = True
        .Create m_lHostHwnd, 137, 222, 10, 11, ecsLabel
        Set oFont = New StdFont
        With oFont
            .Name = "Small Fonts"
            .Size = 7
            .Bold = True
        End With
        Set .Font = oFont
        .Text = "Size"
        .AutoSize = True
    End With
    
    Set m_cTxSize = New clsODControl
    With m_cTxSize
        .Name = "txtSize"
        .BorderStyle ecbsThin
        .Create m_lHostHwnd, 117, 214, 18, 19, ecsTextBox
        .Text = "8"
    End With
    
    Set m_cLbBackColor = New clsODControl
    With m_cLbBackColor
        .Name = "lblBackColor"
        .BorderStyle ecbsNone
        .AutoBackColor = True
        .Create m_lHostHwnd, 186, 180, 48, 13, ecsLabel
        .Text = "BackColor"
        .AutoSize = True
    End With
    
    Set m_cCbBackColor = New clsODControl
    With m_cCbBackColor
        .Name = "cbBackColor"
        .BorderStyle ecbsThin
        .ThemeStyle = m_eThemeStyle
        If (m_lThemeColor > -1) Then
            .ThemeColor = m_lThemeColor
        End If
        If (m_lOffsetColor > -1) Then
            .HiliteColor = m_lOffsetColor
        End If
        .Create m_lHostHwnd, 186, 192, 160, 120, ecsImageCombo
        .AddItem "More.."
    End With

    Set m_cBtSave = New clsODControl
    With m_cBtSave
        .Name = "cmdSave"
        .HiliteColor = &HCCCCCC
        .ThemeStyle = m_eThemeStyle
        If (m_lThemeColor > -1) Then
            .ThemeColor = m_lThemeColor
        End If
        If (m_lOffsetColor > -1) Then
            .HiliteColor = m_lOffsetColor
        End If
        .Create m_lHostHwnd, 210, 225, 64, 22, ecsCommandButton
        .Text = "Save"
    End With
    
    Set m_cBtClose = New clsODControl
    With m_cBtClose
        .Name = "cmdClose"

⌨️ 快捷键说明

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