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

📄 xpbutton.ctl

📁 在Visual Basic 6.0的环境下
💻 CTL
📖 第 1 页 / 共 3 页
字号:
    UserControl.ForeColor = 7617536
    RoundRect UserControl.hdc, 0, 0, ScaleWidth - 1, ScaleHeight - 1, lonRoundValue, lonRoundValue
    
    If bolMouseOver = True And bolMouseDown = False Then
        'Draw mouse over lines.
        'Top line.
        UserControl.Line (2, 1)-(ScaleWidth - 3, 1), 13627647
        'Left line.
        UserControl.Line (1, 2)-(1, ScaleHeight - 3), 5817338
        'Draw bottom line.
        UserControl.Line (2, ScaleHeight - 3)-(ScaleWidth - 3, ScaleHeight - 3), 38885
        'Draw right line.
        UserControl.Line (ScaleWidth - 3, 2)-(ScaleWidth - 3, ScaleHeight - 3), 6933244
        
        'Draw inner lines.
        'Top inner line.
        UserControl.Line (2, 2)-(ScaleWidth - 3, 2), 9033981
        'Left inner line.
        UserControl.Line (2, 2)-(2, ScaleHeight - 3), 6342907
        'Bottom inner line.
        UserControl.Line (2, ScaleHeight - 4)-(ScaleWidth - 3, ScaleHeight - 4), 3191800
        'Right inner line.
        UserControl.Line (ScaleWidth - 4, 2)-(ScaleWidth - 4, ScaleHeight - 3), 6408186
        
        GoTo XPBlueDone
    End If
    
    If bolHasFocus = True And bolMouseDown = False Then
        'Draw has focus lines.
        'Top line.
        UserControl.Line (2, 1)-(ScaleWidth - 3, 1), 16771022
        'Left line.
        UserControl.Line (1, 2)-(1, ScaleHeight - 3), 15383452
        'Draw bottom line.
        UserControl.Line (2, ScaleHeight - 3)-(ScaleWidth - 3, ScaleHeight - 3), 15630953
        'Draw right line.
        UserControl.Line (ScaleWidth - 3, 2)-(ScaleWidth - 3, ScaleHeight - 3), 15448988
        
        'Draw inner lines.
        'Top inner line.
        UserControl.Line (2, 2)-(ScaleWidth - 3, 2), 16176316
        'Left inner line.
        UserControl.Line (2, 2)-(2, ScaleHeight - 3), 15449245
        'Bottom inner line.
        UserControl.Line (2, ScaleHeight - 4)-(ScaleWidth - 3, ScaleHeight - 4), 14986633
        'Right inner line.
        UserControl.Line (ScaleWidth - 4, 2)-(ScaleWidth - 4, ScaleHeight - 3), 15448989
        
        If bolFocusDottedRect = True Then
            'Draw dotted focus rect.
            DrawDottedFocusRect
        End If
        
        GoTo XPBlueDone
    
    End If
    
    If bolMouseDown = True Then
        'Draw gradient for mouse down.
        objGrad.DefineRect 0, 0, ScaleWidth, ScaleHeight
        objGrad.DrawGradient UserControl.hdc, [Top To Bottom], 14542053, 14344930
        
        'Draw main border.
        UserControl.ForeColor = 7617536
        RoundRect UserControl.hdc, 0, 0, ScaleWidth - 1, ScaleHeight - 1, lonRoundValue, lonRoundValue
        
        'Draw button in mouse down state.
        'Top line.
        UserControl.Line (2, 1)-(ScaleWidth - 3, 1), 12700881
        'Left line.
        UserControl.Line (1, 2)-(1, ScaleHeight - 3), 13358295
        'Draw bottom line.
        UserControl.Line (2, ScaleHeight - 3)-(ScaleWidth - 3, ScaleHeight - 3), 15659506
        'Draw right line.
        UserControl.Line (ScaleWidth - 3, 2)-(ScaleWidth - 3, ScaleHeight - 3), 14410724
        
        'Draw inner lines.
        'Top inner line.
        UserControl.Line (2, 2)-(ScaleWidth - 3, 2), 13621468
        'Left inner line.
        UserControl.Line (2, 2)-(2, ScaleHeight - 3), 13884381
        'Bottom inner line.
        UserControl.Line (2, ScaleHeight - 4)-(ScaleWidth - 3, ScaleHeight - 4), 14936554
        'Right inner line.
        UserControl.Line (ScaleWidth - 4, 2)-(ScaleWidth - 4, ScaleHeight - 3), 14410467
        
        If bolHasFocus = True And bolFocusDottedRect = True Then
            DrawDottedFocusRect
        End If
        
        GoTo XPBlueDone
    End If
    
XPBlueDone:
    'Drawing complete, now we just need to draw the Icon and caption.
    'Draw icon.
    DrawIcon
    'Draw caption.
    UserControl.ForeColor = oleForeColor
    PrintText strCaption, udtCaptionAlign
    
    Exit Sub 'All done, stop here (all other statements (code) are omitted and not executed).

ElseIf udtColorStyle = [XP Olive Green] Then
    'Draw XP olive green button.
    
    If bolEnabled = False Then
        GoTo DrawDisabled
    End If
    
    'Draw gradient background.
    objGrad.DefineRect 0, 0, ScaleWidth, ScaleHeight
    objGrad.DrawGradient UserControl.hdc, [Top To Bottom], 15925246, 14413555
        
    'Draw main border.
    UserControl.ForeColor = 418359
    RoundRect UserControl.hdc, 0, 0, ScaleWidth - 1, ScaleHeight - 1, lonRoundValue, lonRoundValue
    
    If bolMouseOver = True And bolMouseDown = False Then
        'Draw mouse over lines.
        'Top line.
        UserControl.Line (2, 1)-(ScaleWidth - 3, 1), 9815548
        'Left line.
        UserControl.Line (1, 2)-(1, ScaleHeight - 3), 7777000
        'Draw bottom line.
        UserControl.Line (2, ScaleHeight - 3)-(ScaleWidth - 3, ScaleHeight - 3), 2454223
        'Draw right line.
        UserControl.Line (ScaleWidth - 3, 2)-(ScaleWidth - 3, ScaleHeight - 3), 7317223
        
        'Draw inner lines.
        'Top inner line.
        UserControl.Line (2, 2)-(ScaleWidth - 3, 2), 9879277
        'Left inner line.
        UserControl.Line (2, 2)-(2, ScaleHeight - 3), 7317223
        'Bottom inner line.
        UserControl.Line (2, ScaleHeight - 4)-(ScaleWidth - 3, ScaleHeight - 4), 5214691
        'Right inner line.
        UserControl.Line (ScaleWidth - 4, 2)-(ScaleWidth - 4, ScaleHeight - 3), 7842791
        
        GoTo XPOliveDone
    End If
    
    If bolHasFocus = True And bolMouseDown = False Then
        'Draw has focus lines.
        'Top line.
        UserControl.Line (2, 1)-(ScaleWidth - 3, 1), 9425346
        'Left line.
        UserControl.Line (1, 2)-(1, ScaleHeight - 3), 6801312
        'Draw bottom line.
        UserControl.Line (2, ScaleHeight - 3)-(ScaleWidth - 3, ScaleHeight - 3), 6727592
        'Draw right line.
        UserControl.Line (ScaleWidth - 3, 2)-(ScaleWidth - 3, ScaleHeight - 3), 6866593
        
        'Draw inner lines.
        'Top inner line.
        UserControl.Line (2, 2)-(ScaleWidth - 3, 2), 8440753
        'Left inner line.
        UserControl.Line (2, 2)-(2, ScaleHeight - 3), 6276251
        'Bottom inner line.
        UserControl.Line (2, ScaleHeight - 4)-(ScaleWidth - 3, ScaleHeight - 4), 5554576
        'Right inner line.
        UserControl.Line (ScaleWidth - 4, 2)-(ScaleWidth - 4, ScaleHeight - 3), 6144920
        
        If bolFocusDottedRect = True Then
            'Draw dotted focus rect.
            DrawDottedFocusRect
        End If
        
        GoTo XPOliveDone
    
    End If
    
    If bolMouseDown = True Then
        'Draw gradient for mouse down.
        objGrad.DefineRect 0, 0, ScaleWidth, ScaleHeight
        objGrad.DrawGradient UserControl.hdc, [Top To Bottom], 13821678, 13559020
        
        'Draw main border.
        UserControl.ForeColor = 418359
        RoundRect UserControl.hdc, 0, 0, ScaleWidth - 1, ScaleHeight - 1, lonRoundValue, lonRoundValue
        
        'Draw button in mouse down state.
        'Top line.
        UserControl.Line (2, 1)-(ScaleWidth - 3, 1), 11849183
        'Left line.
        UserControl.Line (1, 2)-(1, ScaleHeight - 3), 12571875
        'Draw bottom line.
        UserControl.Line (2, ScaleHeight - 3)-(ScaleWidth - 3, ScaleHeight - 3), 15004920
        'Draw right line.
        UserControl.Line (ScaleWidth - 3, 2)-(ScaleWidth - 3, ScaleHeight - 3), 13624814
        
        'Draw inner lines.
        'Top inner line.
        UserControl.Line (2, 2)-(ScaleWidth - 3, 2), 12835303
        'Left inner line.
        UserControl.Line (2, 2)-(2, ScaleHeight - 3), 13032680
        'Bottom inner line.
        UserControl.Line (2, ScaleHeight - 4)-(ScaleWidth - 3, ScaleHeight - 4), 14216434
        'Right inner line.
        UserControl.Line (ScaleWidth - 4, 2)-(ScaleWidth - 4, ScaleHeight - 3), 13624557
        
        If bolHasFocus = True And bolFocusDottedRect = True Then
            DrawDottedFocusRect
        End If
        
        GoTo XPOliveDone
    End If
    
XPOliveDone:
    'Drawing complete, now we just need to draw the Icon and caption.
    'Draw icon.
    DrawIcon
    'Draw caption.
    UserControl.ForeColor = oleForeColor
    PrintText strCaption, udtCaptionAlign
    
    Exit Sub 'All done, stop here (all other statements (code) are omitted and not executed).

ElseIf udtColorStyle = [XP Silver] Then
        'Draw XP blue button.
    
    If bolEnabled = False Then
        GoTo DrawDisabled
    End If
    
    'Draw gradient background.
    objGrad.DefineRect 0, 0, ScaleWidth, ScaleHeight
    objGrad.DrawGradient UserControl.hdc, [Top To Bottom], 16777215, 14140870
        
    'Draw main border.
    UserControl.ForeColor = 7617536
    RoundRect UserControl.hdc, 0, 0, ScaleWidth - 1, ScaleHeight - 1, lonRoundValue, lonRoundValue
    
    If bolMouseOver = True And bolMouseDown = False Then
        'Draw mouse over lines.
        'Top line.
        UserControl.Line (2, 1)-(ScaleWidth - 3, 1), 13627647
        'Left line.
        UserControl.Line (1, 2)-(1, ScaleHeight - 3), 5817338
        'Draw bottom line.
        UserControl.Line (2, ScaleHeight - 3)-(ScaleWidth - 3, ScaleHeight - 3), 38885
        'Draw right line.
        UserControl.Line (ScaleWidth - 3, 2)-(ScaleWidth - 3, ScaleHeight - 3), 6933244
        
        'Draw inner lines.
        'Top inner line.
        UserControl.Line (2, 2)-(ScaleWidth - 3, 2), 9033981
        'Left inner line.
        UserControl.Line (2, 2)-(2, ScaleHeight - 3), 6342907
        'Bottom inner line.
        UserControl.Line (2, ScaleHeight - 4)-(ScaleWidth - 3, ScaleHeight - 4), 3191800
        'Right inner line.
        UserControl.Line (ScaleWidth - 4, 2)-(ScaleWidth - 4, ScaleHeight - 3), 6408186
        
        GoTo XPSilverDone
    End If
    
    If bolHasFocus = True And bolMouseDown = False Then
        'Draw has focus lines.
        'Top line.
        UserControl.Line (2, 1)-(ScaleWidth - 3, 1), 16771022
        'Left line.
        UserControl.Line (1, 2)-(1, ScaleHeight - 3), 15515296
        'Draw bottom line.
        UserControl.Line (2, ScaleHeight - 3)-(ScaleWidth - 3, ScaleHeight - 3), 15630953
        'Draw right line.
        UserControl.Line (ScaleWidth - 3, 2)-(ScaleWidth - 3, ScaleHeight - 3), 15448988
        
        'Draw inner lines.
        'Top inner line.
        UserControl.Line (2, 2)-(ScaleWidth - 3, 2), 16176316
        'Left inner line.
        UserControl.Line (2, 2)-(2, ScaleHeight - 3), 16777215
        'Bottom inner line.
        UserControl.Line (2, ScaleHeight - 4)-(ScaleWidth - 3, ScaleHeight - 4), 14986633
        'Right inner line.
        UserControl.Line (ScaleWidth - 4, 2)-(ScaleWidth - 4, ScaleHeight - 3), 16777215
        
        If bolFocusDottedRect = True Then
            'Draw dotted focus rect.
            DrawDottedFocusRect
        End If
        
        GoTo XPSilverDone
    
    End If
    
    If bolMouseDown = True Then
        'Draw gradient for mouse down.
        objGrad.DefineRect 0, 0, ScaleWidth, ScaleHeight
        objGrad.DrawGradient UserControl.hdc, [Top To Bottom], 12430252, 16777215
        
        'Draw main border.
        UserControl.ForeColor = 7617536
        RoundRect UserControl.hdc, 0, 0, ScaleWidth - 1, ScaleHeight - 1, lonRoundValue, lonRoundValue
        
        'Draw button in mouse down state.
        'Top line.
        UserControl.Line (2, 1)-(ScaleWidth - 3, 1), 16777215
        'Left line.
        UserControl.Line (1, 2)-(1, ScaleHeight - 3), 16777215
        'Draw bottom line.
        UserControl.Line (2, ScaleHeight - 3)-(ScaleWidth - 3, ScaleHeight - 3), 16777215
        'Draw right line.
        UserControl.Line (ScaleWidth - 3, 2)-(ScaleWidth - 3, ScaleHeight - 3), 16777215
        
        If bolHasFocus = True And bolFocusDottedRect = True Then
            DrawDottedFocusRect
        End If
        
        GoTo XPSilverDone
    End If
    
XPSilverDone:
    'Drawing complete, now we just need to draw the Icon and caption.

⌨️ 快捷键说明

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