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

📄 yfcheck.ctl

📁 这是好东西南的,大家快来看看呀,对于有C语言编程的的有好大的帮助
💻 CTL
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.UserControl YFCheckButton 
   BackColor       =   &H00FCBD6C&
   ClientHeight    =   930
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   4080
   ScaleHeight     =   930
   ScaleWidth      =   4080
   ToolboxBitmap   =   "YFCheck.ctx":0000
   Begin MSComctlLib.ImageList ImageList2 
      Left            =   2700
      Top             =   180
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   10
      ImageHeight     =   10
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   4
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "YFCheck.ctx":0312
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "YFCheck.ctx":1769
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "YFCheck.ctx":2BC3
            Key             =   ""
         EndProperty
         BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "YFCheck.ctx":2C39
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin VB.Label labFX 
      BackStyle       =   0  'Transparent
      Caption         =   " 关键字查询"
      ForeColor       =   &H00404040&
      Height          =   225
      Left            =   180
      TabIndex        =   0
      Top             =   0
      Width           =   1485
   End
   Begin VB.Image imgFX 
      Height          =   150
      Left            =   30
      Picture         =   "YFCheck.ctx":2CB2
      Top             =   0
      Width           =   150
   End
End
Attribute VB_Name = "YFCheckButton"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
'*************************************************************************
'**模 块 名:YFCheckButton
'**说    明:YFsoft YFsoft 叶帆Blog:http://blog.csdn.net/yefanqiu/
'**创 建 人:叶帆
'**日    期:2004-12-14 09:34:39
'**修 改 人:
'**日    期:
'**描    述:check 控件
'**版    本:V1.0.0
'*************************************************************************
Option Explicit
Dim m_Value As Boolean
Dim m_Text As String
Dim m_color As String

Event Click()

Private Sub UserControl_Initialize()
    m_Text = "Check"
    labFX.Caption = m_Text
    m_color = "000000"
End Sub

Private Sub UserControl_Resize()
     UserControl.Height = 180
     imgFX.Left = 0
     labFX.Left = imgFX.Left + imgFX.Width + 10
     labFX.Width = UserControl.Width - imgFX.Width + 10
End Sub

Private Sub labFX_Click()
  imgFX_Click
End Sub

Private Sub imgFX_Click()
      m_Value = Not m_Value
      If m_Value = True Then
       imgFX.Picture = ImageList2.ListImages(2).Picture
       Else
       imgFX.Picture = ImageList2.ListImages(1).Picture
      End If
      RaiseEvent Click
End Sub

'从PropertyBag中读属性值
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
   '--------------------------------------------------------------
   '取数据
        m_Text = PropBag.ReadProperty("Text", "Check")
        m_Value = PropBag.ReadProperty("Value", False)
        m_color = PropBag.ReadProperty("Color", "000000")
        If Len(m_color) < 6 Then
            m_color = Left("000000", 6 - Len(m_color)) + m_color
        Else
            m_color = Left(m_color, 6)
        End If
        labFX.ForeColor = RGB(Val("&h" + Mid(m_color, 1, 2)), Val("&h" + Mid(m_color, 3, 2)), Val("&h" + Mid(m_color, 5, 2)))
       
        labFX.Caption = m_Text
        If m_Value = True Then
         imgFX.Picture = ImageList2.ListImages(2).Picture
        Else
         imgFX.Picture = ImageList2.ListImages(1).Picture
        End If
End Sub
'把属性值保存在PropertyBag中
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
   '----------------------------------------------------------------
   '存属性值
   PropBag.WriteProperty "Text", m_Text, "Check"
   PropBag.WriteProperty "Value", m_Value, False
   PropBag.WriteProperty "Color", m_color, "000000"
   
End Sub
Public Property Get Color() As String
  Color = m_color
       
End Property

Public Property Let Color(ByVal vNewValue As String)
    m_color = vNewValue
       If Len(m_color) < 6 Then
            m_color = Left("000000", 6 - Len(m_color)) + m_color
        Else
            m_color = Left(m_color, 6)
        End If
    labFX.ForeColor = RGB(Val("&h" + Mid(m_color, 1, 2)), Val("&h" + Mid(m_color, 3, 2)), Val("&h" + Mid(m_color, 5, 2)))
    PropertyChanged "Color"
End Property

Public Property Get Text() As String
  Text = m_Text
End Property

Public Property Let Text(ByVal vNewValue As String)
    m_Text = vNewValue
    labFX.Caption = m_Text
    PropertyChanged "Text"
End Property

Public Property Get Value() As Boolean
  Value = m_Value
End Property

Public Property Let Value(ByVal vNewValue As Boolean)
    m_Value = vNewValue
      If m_Value = True Then
       imgFX.Picture = ImageList2.ListImages(2).Picture
      Else
       imgFX.Picture = ImageList2.ListImages(1).Picture
      End If
    PropertyChanged "Value"
End Property

⌨️ 快捷键说明

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