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

📄 ftextbox.ctl

📁 超市销售管理系统 4) 文档里面有完整的需求说明书
💻 CTL
📖 第 1 页 / 共 2 页
字号:
End Sub

'注意!不要删除或修改下列被注释的行!
'MappingInfo=Text1,Text1,-1,Locked
Public Property Get Locked() As Boolean
    Locked = Text1.Locked
End Property

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

'注意!不要删除或修改下列被注释的行!
'MappingInfo=Text1,Text1,-1,Text
Public Property Get Text() As String
    Text = Text1.Text
End Property

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

'注意!不要删除或修改下列被注释的行!
'MappingInfo=Text1,Text1,-1,SelLength
Public Property Get SelLength() As Long
    SelLength = Text1.SelLength
End Property

Public Property Let SelLength(ByVal New_SelLength As Long)
    Text1.SelLength() = New_SelLength
    PropertyChanged "SelLength"
End Property

'注意!不要删除或修改下列被注释的行!
'MappingInfo=Text1,Text1,-1,SelStart
Public Property Get SelStart() As Long
    SelStart = Text1.SelStart
End Property

Public Property Let SelStart(ByVal New_SelStart As Long)
    Text1.SelStart() = New_SelStart
    PropertyChanged "SelStart"
End Property

'注意!不要删除或修改下列被注释的行!
'MappingInfo=Text1,Text1,-1,SelText
Public Property Get SelText() As String
    SelText = Text1.SelText
End Property

Public Property Let SelText(ByVal New_SelText As String)
    Text1.SelText() = New_SelText
    PropertyChanged "SelText"
End Property

Private Sub Text1_Change()
    RaiseEvent Change
    If m_isNumber And Text1 = "" Then
        Text1 = "0"
        Text1.SelStart = 0
        Text1.SelLength = 1
    End If
End Sub

Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    RaiseEvent MouseDown(Button, Shift, x, y)
End Sub

Private Sub Text1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    RaiseEvent MouseMove(Button, Shift, x, y)
    
    Dim pos As POINTAPI
    If IfOn = True Then Exit Sub
    onX = x / 15
    onY = y / 15
    GetCursorPos pos
    sX = pos.x
    sY = pos.y
    IfOn = True
    UserControl.Line (0, 0)-(UserControl.Width - 15, UserControl.Height - 15), 6956042, B
    Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
    Dim pos As POINTAPI, l As Long, t As Long, r As Long, b As Long
    GetCursorPos pos
    l = sX - onX
    t = sY - onY
    r = l + UserControl.Width / 15
    b = t + UserControl.Height / 15
    ScreenX = l
    ScreenY = t
    If pos.x < l Or pos.x > r Or pos.y < t Or pos.y > b Then
        IfOn = False
        UserControl.Cls
        Timer1.Enabled = False
        Exit Sub
    End If
End Sub

Private Sub Text1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
    RaiseEvent MouseUp(Button, Shift, x, y)
End Sub

Private Sub Text1_Click()
    RaiseEvent Click
End Sub

'从存贮器中加载属性值
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)

    Text1.BackColor = PropBag.ReadProperty("BackColor", &H80000005)
    Set Text1.Font = PropBag.ReadProperty("Font", Ambient.Font)
    Text1.FontBold = PropBag.ReadProperty("FontBold", 0)
    Text1.FontItalic = PropBag.ReadProperty("FontItalic", 0)
    Text1.FontName = PropBag.ReadProperty("FontName", "")
    Text1.FontSize = PropBag.ReadProperty("FontSize", 0)
    Text1.FontStrikethru = PropBag.ReadProperty("FontStrikethru", 0)
    Text1.FontUnderline = PropBag.ReadProperty("FontUnderline", 0)
    Text1.ForeColor = PropBag.ReadProperty("ForeColor", &H80000008)
    Text1.Locked = PropBag.ReadProperty("Locked", False)
    Text1.Text = PropBag.ReadProperty("Text", "")
    Text1.SelLength = PropBag.ReadProperty("SelLength", 0)
    Text1.SelStart = PropBag.ReadProperty("SelStart", 0)
    Text1.SelText = PropBag.ReadProperty("SelText", "")
    Text1.PasswordChar = PropBag.ReadProperty("PasswordChar", "")
    Text1.Enabled = PropBag.ReadProperty("Enabled", True)
    m_AutoSelAll = PropBag.ReadProperty("AutoSelAll", m_def_AutoSelAll)
    Text1.Alignment = PropBag.ReadProperty("Alignment", 0)
    m_isNumber = PropBag.ReadProperty("isNumber", m_def_isNumber)
    Text1.MaxLength = PropBag.ReadProperty("MaxLength", 0)
    m_afterdecimal = PropBag.ReadProperty("afterdecimal", m_def_afterdecimal)
End Sub

'将属性值写到存储器
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)

    Call PropBag.WriteProperty("BackColor", Text1.BackColor, &H80000005)
    Call PropBag.WriteProperty("Font", Text1.Font, Ambient.Font)
    Call PropBag.WriteProperty("FontBold", Text1.FontBold, 0)
    Call PropBag.WriteProperty("FontItalic", Text1.FontItalic, 0)
    Call PropBag.WriteProperty("FontName", Text1.FontName, "")
    Call PropBag.WriteProperty("FontSize", Text1.FontSize, 0)
    Call PropBag.WriteProperty("FontStrikethru", Text1.FontStrikethru, 0)
    Call PropBag.WriteProperty("FontUnderline", Text1.FontUnderline, 0)
    Call PropBag.WriteProperty("ForeColor", Text1.ForeColor, &H80000008)
    Call PropBag.WriteProperty("Locked", Text1.Locked, False)
    Call PropBag.WriteProperty("Text", Text1.Text, "")
    Call PropBag.WriteProperty("SelLength", Text1.SelLength, 0)
    Call PropBag.WriteProperty("SelStart", Text1.SelStart, 0)
    Call PropBag.WriteProperty("SelText", Text1.SelText, "")
    Call PropBag.WriteProperty("PasswordChar", Text1.PasswordChar, "")
    Call PropBag.WriteProperty("Enabled", Text1.Enabled, True)
    Call PropBag.WriteProperty("AutoSelAll", m_AutoSelAll, m_def_AutoSelAll)
    Call PropBag.WriteProperty("Alignment", Text1.Alignment, 0)
    Call PropBag.WriteProperty("isNumber", m_isNumber, m_def_isNumber)
    Call PropBag.WriteProperty("MaxLength", Text1.MaxLength, 0)
    Call PropBag.WriteProperty("afterdecimal", m_afterdecimal, m_def_afterdecimal)
End Sub

'注意!不要删除或修改下列被注释的行!
'MappingInfo=Text1,Text1,-1,PasswordChar
Public Property Get PasswordChar() As String
    PasswordChar = Text1.PasswordChar
End Property

Public Property Let PasswordChar(ByVal New_PasswordChar As String)
    Text1.PasswordChar() = New_PasswordChar
    PropertyChanged "PasswordChar"
End Property

'注意!不要删除或修改下列被注释的行!
'MappingInfo=Text1,Text1,-1,Enabled
Public Property Get Enabled() As Boolean
    Enabled = Text1.Enabled
End Property

Public Property Let Enabled(ByVal New_Enabled As Boolean)
    Text1.Enabled() = New_Enabled
    PropertyChanged "Enabled"
End Property

'注意!不要删除或修改下列被注释的行!
'MemberInfo=0,0,0,False
Public Property Get AutoSelAll() As Boolean
    AutoSelAll = m_AutoSelAll
End Property

Public Property Let AutoSelAll(ByVal New_AutoSelAll As Boolean)
    m_AutoSelAll = New_AutoSelAll
    PropertyChanged "AutoSelAll"
End Property

'为用户控件初始化属性
Private Sub UserControl_InitProperties()
    m_AutoSelAll = m_def_AutoSelAll
    m_isNumber = m_def_isNumber
    m_afterdecimal = m_def_afterdecimal
End Sub

'注意!不要删除或修改下列被注释的行!
'MappingInfo=Text1,Text1,-1,Alignment
Public Property Get Alignment() As Integer
    Alignment = Text1.Alignment
End Property

Public Property Let Alignment(ByVal New_Alignment As Integer)
    Text1.Alignment() = New_Alignment
    PropertyChanged "Alignment"
End Property

'注意!不要删除或修改下列被注释的行!
'MemberInfo=0,0,0,False
Public Property Get isNumber() As Boolean
    isNumber = m_isNumber
End Property

Public Property Let isNumber(ByVal New_isNumber As Boolean)
    m_isNumber = New_isNumber
    PropertyChanged "isNumber"
End Property

'注意!不要删除或修改下列被注释的行!
'MappingInfo=Text1,Text1,-1,MaxLength
Public Property Get MaxLength() As Long
    MaxLength = Text1.MaxLength
End Property

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

'注意!不要删除或修改下列被注释的行!
'MemberInfo=8,0,0,2
Public Property Get afterdecimal() As Long
    afterdecimal = m_afterdecimal
End Property

Public Property Let afterdecimal(ByVal New_afterdecimal As Long)
    m_afterdecimal = New_afterdecimal
    PropertyChanged "afterdecimal"
End Property


⌨️ 快捷键说明

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