'属性初始值
Const ini_Text = "0"
Const ini_MaxLength = 0
Const ini_PointNum = 2
Const ini_SignFlag = True
Const ini_Align = 0
Const ini_Enabled=True '新加行
'属性设置值
Private ls_Text As String
Private li_MaxLength As Integer
Private li_PointNum As Integer '小数位数
Private lb_SignFlag As Boolean '是否允许输入符号
Private ll_Align As Long
Private lb_Enabled as Boolean '新加行
Private Sub UserControl_InitProperties()
Text = ini_Text
PointNum = ini_PointNum
SignFlag = ini_SignFlag
MaxLength = ini_MaxLength
Enabled=ini_Enabled ''新加行
End Sub
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
With PropBag
Text = .ReadProperty("Text", ini_Text)
PointNum = .ReadProperty("PointNum", ini_PointNum)
SignFlag = .ReadProperty("SignFlag", ini_SignFlag)
MaxLength = .ReadProperty("MaxLength", ini_MaxLength)
Align = .ReadProperty("Align", ini_Align)
enabled=.readProperty("Enabled",ini_enabled) '新加行
End With
End Sub
Public Property Get Text() As String
Text = ls_Text
End Property
Public Property Let Text(ByVal vNewValue As String)
ls_Text = vNewValue
txtMask.Text = ls_Text
UserControl.PropertyChanged "Text"
End Property
Public Property Get PointNum() As Integer
PointNum = li_PointNum
End Property
Public Property Let PointNum(ByVal vNewValue As Integer)
li_PointNum = vNewValue
UserControl.PropertyChanged "PointNum"
End Property
Public Property Get SignFlag() As Boolean
SignFlag = lb_SignFlag
End Property
Public Property Let SignFlag(ByVal vNewValue As Boolean)
lb_SignFlag = vNewValue
UserControl.PropertyChanged "SignFlag"
End Property
Public Property Get MaxLength() As Integer
MaxLength = li_MaxLength
End Property
Public Property Let MaxLength(ByVal vNewValue As Integer)
li_MaxLength = vNewValue
txtMask.MaxLength = li_MaxLength
UserControl.PropertyChanged "MaxLength"
End Property
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
With PropBag
Call .WriteProperty("Text", ls_Text, ini_Text)
Call .WriteProperty("PointNum", li_PointNum, ini_PointNum)
Call .WriteProperty("SignFlag", lb_SignFlag, ini_SignFlag)
Call .WriteProperty("MaxLength", li_MaxLength, ini_MaxLength)
Call .WriteProperty("Align", ll_Align, ini_Align)
Call .writeProperty("Enabled",lb_enabled,ini_enabled)‘新加行
End With
End Sub
'新加行开始
Public Property Get Enabled() As Boolean
Enabled= lb_Enabled
End Property
Public Property Let Enabled(ByVal vNewValue As Boolean)
lb_enabled = vNewValue
UserControl.PropertyChanged "Enabled"
End Property
'新加行结束
Public Property Get Align() As Variant
Align = ll_Align
End Property
Public Property Let Align(ByVal vNewValue As Variant)
ll_Align = Align
End Property
'属性设置值
Private ls_Text As String
Private li_MaxLength As Integer
Private li_PointNum As Integer '小数位数
Private lb_SignFlag As Boolean '是否允许输入符号
Private ll_Align As Long
Private Sub UserControl_InitProperties()
Text = ini_Text
PointNum = ini_PointNum
SignFlag = ini_SignFlag
MaxLength = ini_MaxLength
End Sub
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
With PropBag
Text = .ReadProperty("Text", ini_Text)
PointNum = .ReadProperty("PointNum", ini_PointNum)
SignFlag = .ReadProperty("SignFlag", ini_SignFlag)
MaxLength = .ReadProperty("MaxLength", ini_MaxLength)
Align = .ReadProperty("Align", ini_Align)
End With
End Sub
Public Property Get Text() As String
Text = ls_Text
End Property
Public Property Let Text(ByVal vNewValue As String)
ls_Text = vNewValue
txtMask.Text = ls_Text
UserControl.PropertyChanged "Text"
End Property
Public Property Get PointNum() As Integer
PointNum = li_PointNum
End Property
Public Property Let PointNum(ByVal vNewValue As Integer)
li_PointNum = vNewValue
UserControl.PropertyChanged "PointNum"
End Property
Public Property Get SignFlag() As Boolean
SignFlag = lb_SignFlag
End Property
Public Property Let SignFlag(ByVal vNewValue As Boolean)
lb_SignFlag = vNewValue
UserControl.PropertyChanged "SignFlag"
End Property
Public Property Get MaxLength() As Integer
MaxLength = li_MaxLength
End Property
Public Property Let MaxLength(ByVal vNewValue As Integer)
li_MaxLength = vNewValue
txtMask.MaxLength = li_MaxLength
UserControl.PropertyChanged "MaxLength"
End Property
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
With PropBag
Call .WriteProperty("Text", ls_Text, ini_Text)
Call .WriteProperty("PointNum", li_PointNum, ini_PointNum)
Call .WriteProperty("SignFlag", lb_SignFlag, ini_SignFlag)
Call .WriteProperty("MaxLength", li_MaxLength, ini_MaxLength)
Call .WriteProperty("Align", ll_Align, ini_Align)
End With
End Sub
Public Property Get Align() As Variant
Align = ll_Align
End Property
Public Property Let Align(ByVal vNewValue As Variant)
ll_Align = Align
End Property