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

📄 xptext.ctl

📁 vb源码之家界面源码,非常详细的说明和代码
💻 CTL
字号:
VERSION 5.00
Begin VB.UserControl XPText 
   Appearance      =   0  'Flat
   BackColor       =   &H80000005&
   ClientHeight    =   345
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   1155
   LockControls    =   -1  'True
   ScaleHeight     =   345
   ScaleWidth      =   1155
   Begin VB.TextBox txtData 
      Appearance      =   0  'Flat
      BorderStyle     =   0  'None
      Height          =   240
      Left            =   60
      TabIndex        =   0
      Top             =   50
      Width           =   1005
   End
   Begin VB.Shape ShapeBorder 
      BorderColor     =   &H00B99D7F&
      Height          =   330
      Left            =   0
      Top             =   0
      Width           =   1125
   End
End
Attribute VB_Name = "XPText"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'*************************************************************************
'**模 块 名:XPText
'**说    明:YFsoft 版权所有2005 - 2006(C)
'**创 建 人:叶帆
'**日    期:2005-11-10 09:31:12
'**修 改 人:
'**日    期:
'**描    述:XP风格的TextBox
'**版    本:V1.0.0
'*************************************************************************
Option Explicit
Public Enum XPTEXT_SCROLL
    None = 0
    Horizontal = 1
    Vertical = 2
    Both = 3
End Enum

Event Change()

'*************************************************************************
'**函 数 名:txtData_Change
'**输    入:无
'**输    出:无
'**功能描述:
'**全局变量:
'**调用模块:
'**作    者:叶帆
'**日    期:2005-11-10 10:10:23
'**修 改 人:
'**日    期:
'**版    本:V1.0.0
'*************************************************************************
Private Sub txtData_Change()
    RaiseEvent Change
End Sub

'*************************************************************************
'**函 数 名:UserControl_Resize
'**输    入:无
'**输    出:无
'**功能描述:
'**全局变量:
'**调用模块:
'**作    者:叶帆
'**日    期:2005-11-10 09:32:15
'**修 改 人:
'**日    期:
'**版    本:V1.0.0
'*************************************************************************
Private Sub UserControl_Resize()
    If UserControl.Width < 200 Then UserControl.Width = 200
    If UserControl.Height < 315 Then UserControl.Height = 315

    ShapeBorder.Height = UserControl.Height
    ShapeBorder.Width = UserControl.Width
    txtData.Height = ShapeBorder.Height - 70
    txtData.Width = ShapeBorder.Width - 90

End Sub

'*************************************************************************
'**函 数 名:Enabled
'**输    入:无
'**输    出:(Boolean) -
'**功能描述:
'**全局变量:
'**调用模块:
'**作    者:叶帆
'**日    期:2005-11-10 10:05:23
'**修 改 人:
'**日    期:
'**版    本:V1.0.0
'*************************************************************************
Public Property Get Enabled() As Boolean
    Enabled = UserControl.Enabled
End Property

Public Property Let Enabled(ByVal New_Enabled As Boolean)
    UserControl.Enabled() = New_Enabled
    txtData.Enabled = New_Enabled
    
    If New_Enabled = False Then
        ShapeBorder.BorderColor = &HC0C0C0
    Else
        ShapeBorder.BorderColor = &HB99D7F
    End If
    PropertyChanged "Enabled"
End Property

'*************************************************************************
'**函 数 名:Locked
'**输    入:无
'**输    出:(Boolean) -
'**功能描述:
'**全局变量:
'**调用模块:
'**作    者:叶帆
'**日    期:2005-11-10 10:05:25
'**修 改 人:
'**日    期:
'**版    本:V1.0.0
'*************************************************************************
Public Property Get Locked() As Boolean
    Locked = txtData.Locked
End Property

Public Property Let Locked(ByVal New_Locked As Boolean)
    txtData.Locked() = New_Locked
    PropertyChanged "Locked"
End Property

'*************************************************************************
'**函 数 名:Text
'**输    入:无
'**输    出:(String) -
'**功能描述:
'**全局变量:
'**调用模块:
'**作    者:叶帆
'**日    期:2005-11-10 10:05:28
'**修 改 人:
'**日    期:
'**版    本:V1.0.0
'*************************************************************************
Public Property Get Text() As String
    Text = txtData.Text
End Property

Public Property Let Text(ByVal New_Text As String)
    txtData.Text() = New_Text
    PropertyChanged "Text"
End Property

'*************************************************************************
'**函 数 名:MaxLength
'**输    入:无
'**输    出:(Long) -
'**功能描述:
'**全局变量:
'**调用模块:
'**作    者:叶帆
'**日    期:2005-11-10 10:31:54
'**修 改 人:
'**日    期:
'**版    本:V1.0.0
'*************************************************************************
Public Property Get MaxLength() As Long
    MaxLength = txtData.MaxLength
End Property

Public Property Let MaxLength(ByVal New_MaxLength As Long)
    txtData.MaxLength() = New_MaxLength
    PropertyChanged "MaxLength"
End Property

'*************************************************************************
'**函 数 名:SelText
'**输    入:无
'**输    出:(String) -
'**功能描述:
'**全局变量:
'**调用模块:
'**作    者:叶帆
'**日    期:2005-11-10 14:28:16
'**修 改 人:
'**日    期:
'**版    本:V1.0.0
'*************************************************************************
Public Property Get SelText() As String
    SelText = txtData.SelText
End Property

Public Property Let SelText(ByVal New_SelText As String)
    txtData.SelText() = New_SelText
End Property

'*************************************************************************
'**函 数 名:Font
'**输    入:无
'**输    出:(Font) -
'**功能描述:
'**全局变量:
'**调用模块:
'**作    者:叶帆
'**日    期:2005-11-10 10:05:30
'**修 改 人:
'**日    期:
'**版    本:V1.0.0
'*************************************************************************
Public Property Get Font() As Font
    Set Font = txtData.Font
End Property

Public Property Set Font(ByVal New_Font As Font)
    Set txtData.Font = New_Font
    PropertyChanged "Font"
End Property

'*************************************************************************
'**函 数 名:ForeColor
'**输    入:无
'**输    出:(OLE_COLOR) -
'**功能描述:
'**全局变量:
'**调用模块:
'**作    者:叶帆
'**日    期:2005-11-10 10:21:48
'**修 改 人:
'**日    期:
'**版    本:V1.0.0
'*************************************************************************
Public Property Get ForeColor() As OLE_COLOR
    ForeColor = txtData.ForeColor
End Property

Public Property Let ForeColor(ByVal New_ForeColor As OLE_COLOR)
    txtData.ForeColor() = New_ForeColor
    PropertyChanged "ForeColor"
End Property

'*************************************************************************
'**函 数 名:BackColor
'**输    入:无
'**输    出:(OLE_COLOR) -
'**功能描述:
'**全局变量:
'**调用模块:
'**作    者:叶帆
'**日    期:2005-11-10 10:22:15
'**修 改 人:
'**日    期:
'**版    本:V1.0.0
'*************************************************************************
Public Property Get BackColor() As OLE_COLOR
    BackColor = txtData.BackColor
End Property

Public Property Let BackColor(ByVal New_ForeColor As OLE_COLOR)
    txtData.BackColor() = New_ForeColor
    UserControl.BackColor = txtData.BackColor
    PropertyChanged "BackColor"
End Property

'*************************************************************************
'**函 数 名:UserControl_ReadProperties
'**输    入:PropBag(PropertyBag) -
'**输    出:无
'**功能描述:
'**全局变量:
'**调用模块:
'**作    者:叶帆
'**日    期:2005-11-10 10:05:34
'**修 改 人:
'**日    期:
'**版    本:V1.0.0
'*************************************************************************
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
    UserControl.Enabled = PropBag.ReadProperty("Enabled", True)
    txtData.Enabled = UserControl.Enabled
    If UserControl.Enabled = False Then
        ShapeBorder.BorderColor = &HC0C0C0
    Else
        ShapeBorder.BorderColor = &HB99D7F
    End If

    txtData.Locked = PropBag.ReadProperty("Locked", False)
    txtData.Text = PropBag.ReadProperty("Text", "0")
    Set txtData.Font = PropBag.ReadProperty("Font", Ambient.Font)

    txtData.ForeColor = PropBag.ReadProperty("ForeColor", vbBlack)
    txtData.BackColor = PropBag.ReadProperty("BackColor", vbWhite)
    UserControl.BackColor = txtData.BackColor

    txtData.MaxLength = PropBag.ReadProperty("MaxLength", 0)
End Sub


'*************************************************************************
'**函 数 名:UserControl_WriteProperties
'**输    入:PropBag(PropertyBag) -
'**输    出:无
'**功能描述:
'**全局变量:
'**调用模块:
'**作    者:叶帆
'**日    期:2005-11-10 10:05:39
'**修 改 人:
'**日    期:
'**版    本:V1.0.0
'*************************************************************************
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
    With PropBag
        Call .WriteProperty("Enabled", UserControl.Enabled, True)
        Call .WriteProperty("Locked", txtData.Locked, False)
        Call .WriteProperty("Text", txtData.Text, "0")
        Call .WriteProperty("Font", txtData.Font, Ambient.Font)
        Call .WriteProperty("ForeColor", txtData.ForeColor, vbBlack)
        Call .WriteProperty("BackColor", txtData.BackColor, vbWhite)
        Call .WriteProperty("MaxLength", txtData.MaxLength, 0)
    End With
End Sub

⌨️ 快捷键说明

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