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

📄 yftab.ctl

📁 这是好东西南的,大家快来看看呀,对于有C语言编程的的有好大的帮助
💻 CTL
字号:
VERSION 5.00
Begin VB.UserControl YFTab 
   BackColor       =   &H00FCBD6C&
   ClientHeight    =   5475
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   4365
   ControlContainer=   -1  'True
   ScaleHeight     =   5475
   ScaleWidth      =   4365
   ToolboxBitmap   =   "YFTab.ctx":0000
   Begin VB.Label lblText 
      BackStyle       =   0  'Transparent
      ForeColor       =   &H00FF0000&
      Height          =   225
      Index           =   7
      Left            =   0
      TabIndex        =   7
      Top             =   0
      Width           =   885
   End
   Begin VB.Label lblText 
      BackStyle       =   0  'Transparent
      ForeColor       =   &H00FF0000&
      Height          =   225
      Index           =   6
      Left            =   0
      TabIndex        =   6
      Top             =   0
      Width           =   885
   End
   Begin VB.Label lblText 
      BackStyle       =   0  'Transparent
      ForeColor       =   &H00FF0000&
      Height          =   225
      Index           =   5
      Left            =   0
      TabIndex        =   5
      Top             =   0
      Width           =   885
   End
   Begin VB.Label lblText 
      BackStyle       =   0  'Transparent
      ForeColor       =   &H00FF0000&
      Height          =   225
      Index           =   4
      Left            =   0
      TabIndex        =   4
      Top             =   0
      Width           =   885
   End
   Begin VB.Label lblText 
      BackStyle       =   0  'Transparent
      ForeColor       =   &H00FF0000&
      Height          =   225
      Index           =   3
      Left            =   0
      TabIndex        =   3
      Top             =   0
      Width           =   885
   End
   Begin VB.Label lblText 
      BackStyle       =   0  'Transparent
      ForeColor       =   &H00FF0000&
      Height          =   225
      Index           =   2
      Left            =   0
      TabIndex        =   2
      Top             =   0
      Width           =   885
   End
   Begin VB.Label lblText 
      BackStyle       =   0  'Transparent
      ForeColor       =   &H00FF0000&
      Height          =   225
      Index           =   1
      Left            =   0
      TabIndex        =   1
      Top             =   0
      Width           =   885
   End
   Begin VB.Label lblText 
      BackStyle       =   0  'Transparent
      ForeColor       =   &H00FF0000&
      Height          =   225
      Index           =   0
      Left            =   630
      TabIndex        =   0
      Top             =   2760
      Width           =   885
   End
   Begin VB.Line line1 
      BorderColor     =   &H00FF8080&
      Index           =   15
      X1              =   0
      X2              =   0
      Y1              =   0
      Y2              =   1770
   End
   Begin VB.Line line1 
      BorderColor     =   &H00FF8080&
      Index           =   14
      X1              =   0
      X2              =   0
      Y1              =   0
      Y2              =   1770
   End
   Begin VB.Line line1 
      BorderColor     =   &H00FF8080&
      Index           =   13
      X1              =   0
      X2              =   0
      Y1              =   0
      Y2              =   1770
   End
   Begin VB.Line line1 
      BorderColor     =   &H00FF8080&
      Index           =   12
      X1              =   0
      X2              =   0
      Y1              =   0
      Y2              =   1770
   End
   Begin VB.Line line1 
      BorderColor     =   &H00FF8080&
      Index           =   11
      X1              =   0
      X2              =   0
      Y1              =   0
      Y2              =   1770
   End
   Begin VB.Line line1 
      BorderColor     =   &H00FF8080&
      Index           =   10
      X1              =   0
      X2              =   0
      Y1              =   0
      Y2              =   1770
   End
   Begin VB.Line line1 
      BorderColor     =   &H00FF8080&
      Index           =   9
      X1              =   0
      X2              =   0
      Y1              =   0
      Y2              =   1770
   End
   Begin VB.Line line1 
      BorderColor     =   &H00FF8080&
      Index           =   8
      X1              =   0
      X2              =   0
      Y1              =   0
      Y2              =   1770
   End
   Begin VB.Line line1 
      BorderColor     =   &H00FCF2DA&
      Index           =   7
      X1              =   0
      X2              =   0
      Y1              =   0
      Y2              =   1770
   End
   Begin VB.Line line1 
      BorderColor     =   &H00FF8080&
      Index           =   6
      X1              =   0
      X2              =   0
      Y1              =   0
      Y2              =   1770
   End
   Begin VB.Line line1 
      BorderColor     =   &H00FCF2DA&
      Index           =   5
      X1              =   0
      X2              =   0
      Y1              =   0
      Y2              =   1770
   End
   Begin VB.Line line1 
      BorderColor     =   &H00FF8080&
      Index           =   4
      X1              =   0
      X2              =   0
      Y1              =   0
      Y2              =   1770
   End
   Begin VB.Line line1 
      BorderColor     =   &H00FF8080&
      Index           =   3
      X1              =   0
      X2              =   0
      Y1              =   0
      Y2              =   1770
   End
   Begin VB.Line line1 
      BorderColor     =   &H00FCF2DA&
      Index           =   2
      X1              =   0
      X2              =   0
      Y1              =   0
      Y2              =   1770
   End
   Begin VB.Line line1 
      BorderColor     =   &H00FCF2DA&
      Index           =   1
      X1              =   0
      X2              =   0
      Y1              =   0
      Y2              =   1770
   End
   Begin VB.Line line1 
      BorderColor     =   &H00FF8080&
      Index           =   16
      X1              =   30
      X2              =   30
      Y1              =   720
      Y2              =   2490
   End
End
Attribute VB_Name = "YFTab"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
'*************************************************************************
'**模 块 名:YFTab
'**说    明:YFsoft 叶帆Blog:http://blog.csdn.net/yefanqiu/
'**创 建 人:叶帆
'**日    期:2004-12-14 10:03:09
'**修 改 人:
'**日    期:
'**描    述:TabBox 控件
'**版    本:V1.0.0
'*************************************************************************
Option Explicit
Dim m_TextNum  As Integer
Dim m_Tab As Integer
Dim m_Height As Integer
Dim m_Len(8) As Integer
Dim m_Text() As String
Dim m_strData As String
Dim m_color As String
Event Click(no As Integer)

Private Sub lblText_Click(index As Integer)
   m_Tab = index
   UserControl_Resize
   RaiseEvent Click(index)
End Sub

Private Sub UserControl_Initialize()
  Dim i As Integer
  m_TextNum = 3
  m_Tab = 1
  m_Height = 250
  For i = 0 To m_TextNum - 1
   m_Len(i) = 600
  Next i
  
  For i = 1 To 15
    line1(i).Visible = False
    If i < 9 + m_TextNum + 1 Then line1(i).Visible = True
  Next i
  m_color = "0000ff"
  m_strData = "标签1@标签2@标签3标签4@标签5@标签6标签7@标签8"
  m_Text = Split(m_strData, "@")
End Sub

Private Sub UserControl_Resize()
 Dim i As Integer
  
  For i = 1 To 16
    line1(i).Visible = False
    If i < 9 + m_TextNum + 1 Then line1(i).Visible = True
  Next i
  
   line1(1).X1 = 10
   line1(1).Y1 = 10
   line1(1).X2 = 10
   line1(1).Y2 = UserControl.Height - 10 - m_Height
   
   line1(2).X1 = 10
   line1(2).Y1 = 10
   line1(2).X2 = UserControl.Width - 10
   line1(2).Y2 = 10
   
   line1(3).X1 = UserControl.Width - 10
   line1(3).Y1 = 10
   line1(3).X2 = UserControl.Width - 10
   line1(3).Y2 = UserControl.Height - 10 - m_Height
   
   line1(4).X1 = UserControl.Width - 10
   line1(4).Y1 = UserControl.Height - 10 - m_Height
   line1(4).X2 = m_Len(m_Tab) + GetLen(m_Tab) + 10
   line1(4).Y2 = UserControl.Height - 10 - m_Height
    
   
   line1(6).X1 = 10
   line1(6).Y1 = UserControl.Height - 10 - m_Height
   line1(6).X2 = GetLen(m_Tab) + 10
   line1(6).Y2 = UserControl.Height - 10 - m_Height
   
   For i = 9 To 9 + m_TextNum
      line1(i).X1 = GetLen(i - 9) + 10
      line1(i).Y1 = UserControl.Height - 10 - m_Height
      line1(i).X2 = GetLen(i - 9) + 10
      line1(i).Y2 = UserControl.Height - 10
   Next i

   line1(8).X1 = 10
   line1(8).Y1 = UserControl.Height - 10
   line1(8).X2 = GetLen(m_TextNum) + 10
   line1(8).Y2 = UserControl.Height - 10
   line1(8).ZOrder 0
        
   line1(5).X1 = GetLen(m_Tab) + 10
   line1(5).Y1 = UserControl.Height - 10 - m_Height
   line1(5).X2 = GetLen(m_Tab) + 10
   line1(5).Y2 = UserControl.Height - 10
   line1(5).ZOrder 0
   
   line1(7).Visible = False
   
   For i = 0 To m_TextNum - 1
     lblText(i).Left = GetLen(i) + 10 + 50
     lblText(i).Top = UserControl.Height - 10 - m_Height + 50
   Next i
   
   
End Sub

'从PropertyBag中读属性值
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
   '--------------------------------------------------------------
   '取数据
        m_Tab = PropBag.ReadProperty("Tabs", 1)
        m_TextNum = PropBag.ReadProperty("TextNum", 3)
        m_strData = PropBag.ReadProperty("strData", "标签1@标签2@标签3标签4@标签5@标签6标签7@标签8")
        m_Text = Split(m_strData, "@")
        m_color = PropBag.ReadProperty("Color", "0000ff")
         
         
        Dim i As Integer
        For i = 0 To 7
          lblText(i).Visible = False
          If i < m_TextNum Then
            lblText(i).Visible = True
            lblText(i) = m_Text(i)
            m_Len(i) = LenB(m_Text(i)) * 100
            lblText(i).Width = m_Len(i)
            lblText(i).ZOrder 0
          End If
        Next i
         For i = 1 To 15
              line1(i).Visible = False
              If i < 9 + m_TextNum + 1 Then line1(i).Visible = True
          Next i
       For i = 0 To 7
        lblText(i).ForeColor = RGB(Val("&h" + Mid(m_color, 1, 2)), Val("&h" + Mid(m_color, 3, 2)), Val("&h" + Mid(m_color, 5, 2)))
       Next i
                  
        UserControl_Resize
      
End Sub

'把属性值保存在PropertyBag中
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
   '----------------------------------------------------------------
   '存属性值
   PropBag.WriteProperty "Tabs", m_Tab, 1
   PropBag.WriteProperty "TextNum", m_TextNum, 3
   PropBag.WriteProperty "strData", m_strData, "标签1@标签2@标签3标签4@标签5@标签6标签7@标签8"
   PropBag.WriteProperty "Color", m_color, "0000ff"
End Sub
Private Function GetLen(index As Integer) As Integer
Dim i As Integer
  For i = 0 To index - 1
    GetLen = GetLen + m_Len(i)
  Next i
End Function

Public Property Get Tabs() As Integer
   Tabs = m_Tab
   Text = m_Text(m_Tab)
End Property

Public Property Let Tabs(ByVal vNewValue As Integer)
   m_Tab = vNewValue
   UserControl_Resize
   PropertyChanged "Tabs"
End Property


Public Property Get TextNum() As Integer
   TextNum = m_TextNum
End Property

Public Property Let TextNum(ByVal vNewValue As Integer)
   m_TextNum = vNewValue
   UserControl_Resize
   PropertyChanged "TextNum"
End Property

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

Public Property Let Text(ByVal vNewValue As String)
   m_Text(m_Tab) = vNewValue
   lblText(m_Tab) = vNewValue
   m_Len(m_Tab) = LenB(m_Text(m_Tab)) * 100
   lblText(m_Tab).Width = m_Len(m_Tab)
   UserControl_Resize
   m_strData = Join(m_Text, "@")
   PropertyChanged "strData"
End Property
Public Property Get Color() As String
  Color = m_color
       
End Property

Public Property Let Color(ByVal vNewValue As String)
      Dim i As Integer
      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
       For i = 0 To 7
        lblText(i).ForeColor = RGB(Val("&h" + Mid(m_color, 1, 2)), Val("&h" + Mid(m_color, 3, 2)), Val("&h" + Mid(m_color, 5, 2)))
       Next i
    PropertyChanged "Color"
End Property


⌨️ 快捷键说明

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