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

📄 command.ctl

📁 vb源码之家界面源码,非常详细的说明和代码
💻 CTL
📖 第 1 页 / 共 3 页
字号:
        If mDotBackColor = 0 Then
            mDotBackColor = 0 'SkinGetData("Bar", "BackColor")
            If mDotBackColor = 0 Then
                mDotBackColor = &H8000000F
            End If
        End If

        UserControl.PSet (0, 0), mDotBackColor
        UserControl.PSet (UserControl.Width / 15 - 1, 0), mDotBackColor
        UserControl.PSet (0, UserControl.Height / 15 - 1), mDotBackColor
        UserControl.PSet (UserControl.Width / 15 - 1, UserControl.Height / 15 - 1), mDotBackColor
    End With

    '------------------------------------------------

    Exit Sub

    '----------------
ToExit:
    Resume Next
End Sub

Private Sub DrawFocus()
    On Error GoTo ToExit '打开错误陷阱
    '------------------------------------------------
    Dim Gradient As New Collection, X As Long

    With UserControl
    ' Draws border lines (not corners)
        Line (3, 0)-(.ScaleWidth - 3, 0), BorderColorLinesF
        Line (0, 3)-(0, .ScaleHeight - 3), BorderColorLinesF
        Line (3, .ScaleHeight - 1)-(.ScaleWidth - 3, .ScaleHeight - 1), BorderColorLinesF
        Line (.ScaleWidth - 1, 3)-(.ScaleWidth - 1, .ScaleHeight - 3), BorderColorLinesF
    
    ' Draws the fade at the bottom.
        Line (1, .ScaleHeight - 4)-(.ScaleWidth - 1, .ScaleHeight - 4), FirstBottomLineF
        Line (2, .ScaleHeight - 3)-(.ScaleWidth - 2, .ScaleHeight - 3), SecondBottomLineF
        Line (3, ScaleHeight - 2)-(.ScaleWidth - 3, .ScaleHeight - 2), ThirdBottomLineF
        
    ' Draws the background gradient.
        Set Gradient = CreateFade(FromColorFadeF, ToColorFadeF, .ScaleHeight - 5)
        
        For X = 1 To Gradient.Count
            Select Case X
                Case 1
                    Line (3, X + 1)-(.ScaleWidth - 4, X + 1), FirstTopLineF
                Case 2
                    Line (2, X + 1)-(.ScaleWidth - 3, X + 1), SecondTopLineF
                Case Else
                    Line (1, X + 1)-(.ScaleWidth - 2, X + 1), Gradient(X)
            End Select
        Next
    
    ' Draws side gradients
        Set Gradient = CreateFade(SideFromColorFadeF, SideToColorFadeF, .ScaleHeight - 7)
        
        For X = 1 To Gradient.Count
            PSet (1, X + 3), Gradient(X)
            PSet (2, X + 3), Gradient(X)
            
            PSet (.ScaleWidth - 2, X + 3), Gradient(X)
            PSet (.ScaleWidth - 3, X + 3), Gradient(X)
        Next
        
    ' Draws corners
    ' First set of pixels
        
        ' Upper Left Corner
        PSet (2, 0), FirstCornerPixelF
        PSet (0, 2), FirstCornerPixelF
        
        ' Bottom left corner
        PSet (0, .ScaleHeight - 3), FirstCornerPixelF
        PSet (2, .ScaleHeight - 1), FirstCornerPixelF
        
        ' Top right corner
        PSet (.ScaleWidth - 1, 2), FirstCornerPixelF
        PSet (.ScaleWidth - 3, 0), FirstCornerPixelF
        
        ' Bottom right corner
        PSet (.ScaleWidth - 3, .ScaleHeight - 1), FirstCornerPixelF
        PSet (.ScaleWidth - 1, .ScaleHeight - 3), FirstCornerPixelF
        
    ' Second set of pixels
        ' Upper Left Corner
        PSet (1, 0), SecondCornerPixelF
        PSet (0, 1), SecondCornerPixelF
        
        ' Bottom left corner
        PSet (0, .ScaleHeight - 2), SecondCornerPixelF
        PSet (1, .ScaleHeight - 1), SecondCornerPixelF
        
        ' Top right corner
        PSet (.ScaleWidth - 1, 1), SecondCornerPixelF
        PSet (.ScaleWidth - 2, 0), SecondCornerPixelF
        
        ' Bottom right corner
        PSet (.ScaleWidth - 2, .ScaleHeight - 1), SecondCornerPixelF
        PSet (.ScaleWidth - 1, .ScaleHeight - 2), SecondCornerPixelF
    
    ' Third set of pixels
        PSet (1, 1), ThirdCornerPixelF
        PSet (1, .ScaleHeight - 2), ThirdCornerPixelF
        PSet (.ScaleWidth - 2, 1), ThirdCornerPixelF
        PSet (.ScaleWidth - 2, .ScaleHeight - 2), ThirdCornerPixelF
    
    'Fourth set of pixels
        ' Upper left corner
        PSet (2, 1), FourthCornerPixelF
        PSet (1, 2), FourthCornerPixelF
        
        ' Bottom left corner
        PSet (1, .ScaleHeight - 3), FourthCornerPixelF
        PSet (2, .ScaleHeight - 2), FourthCornerPixelF
        
        ' Bottom right corner
        PSet (.ScaleWidth - 3, .ScaleHeight - 2), FourthCornerPixelF
        PSet (.ScaleWidth - 2, .ScaleHeight - 3), FourthCornerPixelF
        
        ' Top right corner.
        PSet (.ScaleWidth - 3, 1), FourthCornerPixelF
        PSet (.ScaleWidth - 2, 2), FourthCornerPixelF
    End With
    '------------------------------------------------
    Exit Sub
    '----------------
ToExit:
    Resume Next
End Sub

Private Sub DrawDown()
    On Error GoTo ToExit '打开错误陷阱
    '------------------------------------------------
    Dim X As Long, Gradient As New Collection

    With UserControl
    ' Draws border lines (not corners)
        Line (3, 0)-(.ScaleWidth - 3, 0), BorderColorLinesD
        Line (0, 3)-(0, .ScaleHeight - 3), BorderColorLinesD
        Line (3, .ScaleHeight - 1)-(.ScaleWidth - 3, .ScaleHeight - 1), BorderColorLinesD
        Line (.ScaleWidth - 1, 3)-(.ScaleWidth - 1, .ScaleHeight - 3), BorderColorLinesD
    
    ' Draws the fade at the bottom
        Line (1, .ScaleHeight - 4)-(.ScaleWidth - 1, .ScaleHeight - 4), FirstBottomLineD
        Line (2, .ScaleHeight - 3)-(.ScaleWidth - 2, .ScaleHeight - 3), SecondBottomLineD
        Line (3, ScaleHeight - 2)-(.ScaleWidth - 3, .ScaleHeight - 2), ThirdBottomLineD
        
    ' Draws the background gradient
        Set Gradient = CreateFade(FromColorFadeD, ToColorFadeD, .ScaleHeight - 5)
        
        For X = 1 To Gradient.Count
            Select Case X
                Case 1
                    Line (3, X + 1)-(.ScaleWidth - 4, X + 1), Gradient(X)
                Case 2
                    Line (2, X + 1)-(.ScaleWidth - 3, X + 1), Gradient(X)
                Case Else
                    Line (1, X + 1)-(.ScaleWidth - 2, X + 1), Gradient(X)
            End Select
        Next
        
    ' Draws corners
    ' First set of pixels
        ' Upper Left Corner
        PSet (2, 0), FirstCornerPixelD
        PSet (0, 2), FirstCornerPixelD
        
        ' Bottom left corner
        PSet (0, .ScaleHeight - 3), FirstCornerPixelD
        PSet (2, .ScaleHeight - 1), FirstCornerPixelD
        
        ' Top right corner
        PSet (.ScaleWidth - 1, 2), FirstCornerPixelD
        PSet (.ScaleWidth - 3, 0), FirstCornerPixelD
        
        ' Bottom right corner
        PSet (.ScaleWidth - 3, .ScaleHeight - 1), FirstCornerPixelD
        PSet (.ScaleWidth - 1, .ScaleHeight - 3), FirstCornerPixelD
        
    ' Second set of pixels
        ' Upper Left Corner
        PSet (1, 0), SecondCornerPixelD
        PSet (0, 1), SecondCornerPixelD
        
        ' Bottom left corner
        PSet (0, .ScaleHeight - 2), SecondCornerPixelD
        PSet (1, .ScaleHeight - 1), SecondCornerPixelD
        
        ' Top right corner
        PSet (.ScaleWidth - 1, 1), SecondCornerPixelD
        PSet (.ScaleWidth - 2, 0), SecondCornerPixelD
        
        ' Bottom right corner
        PSet (.ScaleWidth - 2, .ScaleHeight - 1), SecondCornerPixelD
        PSet (.ScaleWidth - 1, .ScaleHeight - 2), SecondCornerPixelD
    
    ' Third set of pixels
        PSet (1, 1), ThirdCornerPixelD
        PSet (1, .ScaleHeight - 2), ThirdCornerPixelD
        PSet (.ScaleWidth - 2, 1), ThirdCornerPixelD
        PSet (.ScaleWidth - 2, .ScaleHeight - 2), ThirdCornerPixelD
    
    ' Fourth set of pixels
        'Upper left corner
        PSet (2, 1), FourthCornerPixelD
        PSet (1, 2), FourthCornerPixelD
        
        ' Bottom left corner
        PSet (1, .ScaleHeight - 3), FourthCornerPixelD
        PSet (2, .ScaleHeight - 2), FourthCornerPixelD
        
        ' Bottom right corner
        PSet (.ScaleWidth - 3, .ScaleHeight - 2), FourthCornerPixelD
        PSet (.ScaleWidth - 2, .ScaleHeight - 3), FourthCornerPixelD
        
        ' Top right corner
        PSet (.ScaleWidth - 3, 1), FourthCornerPixelD
        PSet (.ScaleWidth - 2, 2), FourthCornerPixelD
    End With
    '------------------------------------------------
    Exit Sub
    '----------------
ToExit:
    Resume Next
End Sub

Private Sub DrawDisabled()
    On Error GoTo ToExit '打开错误陷阱
    '------------------------------------------------
    Dim Gradient As New Collection, X As Long

    With UserControl
    ' Draws border lines (not corners)
        Line (3, 0)-(.ScaleWidth - 3, 0), BorderColorLinesX
        Line (0, 3)-(0, .ScaleHeight - 3), BorderColorLinesX
        Line (3, .ScaleHeight - 1)-(.ScaleWidth - 3, .ScaleHeight - 1), BorderColorLinesX
        Line (.ScaleWidth - 1, 3)-(.ScaleWidth - 1, .ScaleHeight - 3), BorderColorLinesX
    
    ' Draws the fade at the bottom
        Line (1, .ScaleHeight - 4)-(.ScaleWidth - 1, .ScaleHeight - 4), FirstBottomLineX
        Line (2, .ScaleHeight - 3)-(.ScaleWidth - 2, .ScaleHeight - 3), SecondBottomLineX
        Line (3, ScaleHeight - 2)-(.ScaleWidth - 3, .ScaleHeight - 2), ThirdBottomLineX
        
    ' Draws the background gradient
        Set Gradient = CreateFade(FromColorFadeX, ToColorFadeX, .ScaleHeight - 5)
        
        For X = 1 To Gradient.Count
            Select Case X
              Case 1
                    Line (3, X + 1)-(.ScaleWidth - 4, X + 1), Gradient(X)
                Case 2
                    Line (2, X + 1)-(.ScaleWidth - 3, X + 1), Gradient(X)
                Case Else
                    Line (1, X + 1)-(.ScaleWidth - 2, X + 1), Gradient(X)
            End Select
        Next
        
    ' Draws corners
    ' First set of pixels
        ' Upper Left Corner
        PSet (2, 0), FirstCornerPixelX
        PSet (0, 2), FirstCornerPixelX
        
        ' Bottom left corner
        PSet (0, .ScaleHeight - 3), FirstCornerPixelX
        PSet (2, .ScaleHeight - 1), FirstCornerPixelX
        
        ' Top right corner
        PSet (.ScaleWidth - 1, 2), FirstCornerPixelX
        PSet (.ScaleWidth - 3, 0), FirstCornerPixelX
        
        ' Bottom right corner
        PSet (.ScaleWidth - 3, .ScaleHeight - 1), FirstCornerPixelX
        PSet (.ScaleWidth - 1, .ScaleHeight - 3), FirstCornerPixelX
        
    ' Second set of pixels
        ' Upper Left Corner
        PSet (1, 0), SecondCornerPixelX
        PSet (0, 1), SecondCornerPixelX
        
        ' Bottom left corner
        PSet (0, .ScaleHeight - 2), SecondCornerPixelX
        PSet (1, .ScaleHeight - 1), SecondCornerPixelX
        
        ' Top right corner
        PSet (.ScaleWidth - 1, 1), SecondCornerPixelX
        PSet (.ScaleWidth - 2, 0), SecondCornerPixelX
        
        'Bottom right corner
        PSet (.ScaleWidth - 2, .ScaleHeight - 1), SecondCornerPixelX
        PSet (.ScaleWidth - 1, .ScaleHeight - 2), SecondCornerPixelX
    
    ' Third set of pixels
        PSet (1, 1), ThirdCornerPixelX
        PSet (1, .ScaleHeight - 2), ThirdCornerPixelX
        PSet (.ScaleWidth - 2, 1), ThirdCornerPixelX
        PSet (.ScaleWidth - 2, .ScaleHeight - 2), ThirdCornerPixelX
    
    ' Fourth set of pixels
        ' Upper left corner
        PSet (2, 1), FourthCornerPixelX
        PSet (1, 2), FourthCornerPixelX

⌨️ 快捷键说明

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