📄 mysize.ctl
字号:
If j > vSizeNumber Then
Exit For
End If
If Mid(SizeHead, i, 1) = "|" Then
LSize(j).Caption = s
j = j + 1
s = ""
Else
s = s & Mid(SizeHead, i, 1)
End If
Next
For i = 1 To vSizeNumber
SizeKeyArray(i) = ""
Next
s = ""
j = 1
For i = 1 To Len(SizeKey)
If j > vSizeNumber Then
Exit For
End If
If Mid(SizeKey, i, 1) = "|" Then
SizeKeyArray(j) = s
j = j + 1
s = ""
Else
s = s & Mid(SizeHead, i, 1)
End If
Next
PrintSize
'UserControl.Refresh
For i = 1 To m_SizeNumber
Select Case i
Case 1
TSize(1).Text = m_SizeField1
Case 2
TSize(2).Text = m_SizeField2
Case 3
TSize(3).Text = m_SizeField3
Case 4
TSize(4).Text = m_SizeField4
Case 5
TSize(5).Text = m_SizeField5
Case 6
TSize(6).Text = m_SizeField6
Case 7
TSize(7).Text = m_SizeField7
Case 8
TSize(8).Text = m_SizeField8
Case 9
TSize(9).Text = m_SizeField9
Case 10
TSize(10).Text = m_SizeField10
Case 11
TSize(11).Text = m_SizeField11
Case 12
TSize(12).Text = m_SizeField12
Case 13
TSize(13).Text = m_SizeField13
Case 14
TSize(14).Text = m_SizeField14
Case 15
TSize(15).Text = m_SizeField15
Case 16
TSize(16).Text = m_SizeField16
Case 17
TSize(17).Text = m_SizeField17
Case 18
TSize(18).Text = m_SizeField18
Case 19
TSize(19).Text = m_SizeField19
Case 20
TSize(20).Text = m_SizeField20
Case 21
TSize(21).Text = m_SizeField21
Case 22
TSize(22).Text = m_SizeField22
Case 23
TSize(23).Text = m_SizeField23
Case 24
TSize(24).Text = m_SizeField24
Case 25
TSize(25).Text = m_SizeField25
Case 26
TSize(26).Text = m_SizeField26
Case 27
TSize(27).Text = m_SizeField27
Case 28
TSize(28).Text = m_SizeField28
Case 29
TSize(29).Text = m_SizeField29
Case 30
TSize(30).Text = m_SizeField30
End Select
Next
'Debug.Print m_SizeField1
End Sub
Private Sub PrintSize()
Dim xWidth As Long, i As Long, aWidth As Long
If UserControl.BorderStyle = 0 Then
aWidth = 0
Else
If UserControl.Appearance = 0 Then
aWidth = 3
Else
aWidth = 5
End If
End If
If Ambient.UserMode Then
'运行期...
If PrintCount Then
xWidth = (UserControl.Width - aWidth - aWidth) / (m_SizeNumber + 1)
Else
xWidth = (UserControl.Width - aWidth - aWidth) / IIf(m_SizeNumber = 0, 1, m_SizeNumber)
LSize(0).Visible = False
TSize(0).Visible = False
Lines(0).Visible = False
End If
For i = 0 To m_SizeNumber - IIf(PrintCount, 0, 1)
If PrintHead Then
LSize(i + IIf(PrintCount, 0, 1)).Top = aWidth
LSize(i + IIf(PrintCount, 0, 1)).Left = i * xWidth + aWidth
LSize(i + IIf(PrintCount, 0, 1)).Height = UserControl.Height / 2 - aWidth
LSize(i + IIf(PrintCount, 0, 1)).Width = xWidth
LSize(i + IIf(PrintCount, 0, 1)).Visible = True
TSize(i + IIf(PrintCount, 0, 1)).Top = UserControl.Height / 2 '+ LineWidth
TSize(i + IIf(PrintCount, 0, 1)).Left = LSize(i + IIf(PrintCount, 0, 1)).Left '+ LineWidth / 2
TSize(i + IIf(PrintCount, 0, 1)).Height = LSize(i + IIf(PrintCount, 0, 1)).Height - LineWidth - LineWidth - aWidth - aWidth
TSize(i + IIf(PrintCount, 0, 1)).Width = LSize(i + IIf(PrintCount, 0, 1)).Width - LineWidth - LineWidth - aWidth - aWidth
TSize(i + IIf(PrintCount, 0, 1)).Visible = True
If i = 0 Then
Lines(i + IIf(PrintCount, 0, 1)).Y1 = UserControl.Height / 2 - LineWidth
Lines(i + IIf(PrintCount, 0, 1)).Y2 = UserControl.Height / 2 - LineWidth
Lines(i + IIf(PrintCount, 0, 1)).X1 = 0
Lines(i + IIf(PrintCount, 0, 1)).X2 = UserControl.Width
Else
Lines(i + IIf(PrintCount, 0, 1)).Y1 = 0
Lines(i + IIf(PrintCount, 0, 1)).Y2 = UserControl.Height
Lines(i + IIf(PrintCount, 0, 1)).X1 = LSize(i + IIf(PrintCount, 0, 1)).Left - LineWidth '- aWidth
Lines(i + IIf(PrintCount, 0, 1)).X2 = Lines(i + IIf(PrintCount, 0, 1)).X1
End If
Lines(i + IIf(PrintCount, 0, 1)).Visible = True
Else
LSize(i + IIf(PrintCount, 0, 1)).Top = aWidth
LSize(i + IIf(PrintCount, 0, 1)).Left = i * xWidth + aWidth
LSize(i + IIf(PrintCount, 0, 1)).Height = UserControl.Height / 2 - aWidth
LSize(i + IIf(PrintCount, 0, 1)).Width = xWidth
LSize(i + IIf(PrintCount, 0, 1)).Visible = True
TSize(i + IIf(PrintCount, 0, 1)).Top = aWidth '+ LineWidth
TSize(i + IIf(PrintCount, 0, 1)).Left = i * xWidth + aWidth '+ LineWidth / 2
TSize(i + IIf(PrintCount, 0, 1)).Height = UserControl.Height - aWidth - aWidth
TSize(i + IIf(PrintCount, 0, 1)).Width = xWidth - LineWidth '- LineWidth '- aWidth - aWidth
TSize(i + IIf(PrintCount, 0, 1)).Visible = True
If i = 0 Then
Lines(i + IIf(PrintCount, 0, 1)).Visible = False
Else
Lines(i + IIf(PrintCount, 0, 1)).Y1 = 0
Lines(i + IIf(PrintCount, 0, 1)).Y2 = UserControl.Height
Lines(i + IIf(PrintCount, 0, 1)).X1 = LSize(i + IIf(PrintCount, 0, 1)).Left - LineWidth '- aWidth
Lines(i + IIf(PrintCount, 0, 1)).X2 = Lines(i + IIf(PrintCount, 0, 1)).X1
Lines(i + IIf(PrintCount, 0, 1)).Visible = True
End If
End If
Next
Else
'设计期...
LSize(0).Top = 0
LSize(0).Left = 0
LSize(0).Height = UserControl.Height / 2
LSize(0).Width = UserControl.Width
LSize(0).Caption = "HEAD"
LSize(0).Visible = True
'---------------------------------------
Lines(0).Y1 = UserControl.Height / 2 - LineWidth
Lines(0).Y2 = UserControl.Height / 2 - LineWidth
Lines(0).X1 = 0
Lines(0).X2 = UserControl.Width
Lines(0).Visible = True
'----------------------------------------
TSize(0).Top = UserControl.Height / 2 + LineWidth
TSize(0).Left = 0
TSize(0).Height = UserControl.Height / 2
TSize(0).Width = UserControl.Width
TSize(0).Text = "TEXT"
TSize(0).Visible = True
End If
' Dim xWidth As Long, i As Long, aWidth As Long
' If UserControl.BorderStyle = 0 Then
' aWidth = 0
' Else
' If UserControl.Appearance = 0 Then
' aWidth = 3
' Else
' aWidth = 5
' End If
' End If
' If Ambient.UserMode Then
' '运行期...
' xWidth = (UserControl.Width - aWidth - aWidth) / (m_SizeNumber + 1)
' For i = 0 To m_SizeNumber
' LSize(i).Top = aWidth
' LSize(i).Left = i * xWidth + aWidth
' LSize(i).Height = UserControl.Height / 2 - aWidth
' LSize(i).Width = xWidth
' LSize(i).Visible = True
' TSize(i).Top = UserControl.Height / 2 '+ LineWidth
' TSize(i).Left = LSize(i).Left '+ LineWidth / 2
' TSize(i).Height = LSize(i).Height - LineWidth - LineWidth - aWidth - aWidth
' TSize(i).Width = LSize(i).Width - LineWidth - LineWidth - aWidth - aWidth
' TSize(i).Visible = True
' If i = 0 Then
' Lines(i).Y1 = UserControl.Height / 2 - LineWidth
' Lines(i).Y2 = UserControl.Height / 2 - LineWidth
' Lines(i).X1 = 0
' Lines(i).X2 = UserControl.Width
' Else
' Lines(i).Y1 = 0
' Lines(i).Y2 = UserControl.Height
' Lines(i).X1 = LSize(i).Left - LineWidth '- aWidth
' Lines(i).X2 = Lines(i).X1
' End If
' Lines(i).ZOrder 0
' Lines(i).Visible = True
' Next
' Else
' '设计期...
' LSize(0).Top = 0
' LSize(0).Left = 0
' LSize(0).Height = UserControl.Height / 2
' LSize(0).Width = UserControl.Width
' LSize(0).Caption = "HEAD"
' LSize(0).Visible = True
' '---------------------------------------
' Lines(0).Y1 = UserControl.Height / 2 - LineWidth
' Lines(0).Y2 = UserControl.Height / 2 - LineWidth
' Lines(0).X1 = 0
' Lines(0).X2 = UserControl.Width
' Lines(0).Visible = True
' '----------------------------------------
' TSize(0).Top = UserControl.Height / 2 + LineWidth
' TSize(0).Left = 0
' TSize(0).Height = UserControl.Height / 2
' TSize(0).Width = UserControl.Width
' TSize(0).Text = "TEXT"
' TSize(0).Visible = True
' End If
End Sub
'注意!不要删除或修改下列被注释的行!
'MemberInfo=13,0,0,
Public Property Get SizeCount() As Currency
Attribute SizeCount.VB_ProcData.VB_Invoke_Property = "StandardDataFormat;数据"
Attribute SizeCount.VB_MemberFlags = "143c"
SizeCount = Val(TSize(0).Text)
End Property
Public Property Let SizeCount(ByVal New_SizeCount As Currency)
If CanPropertyChange("SizeCount") Then
TSize(0).Text = New_SizeCount
PropertyChanged "SizeCount"
End If
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=2,0,2,0
Public Property Get SizeField1() As Currency
Attribute SizeField1.VB_MemberFlags = "141c"
SizeField1 = m_SizeField1
End Property
Public Property Let SizeField1(ByVal New_SizeField1 As Currency)
If Ambient.UserMode = False Then Err.Raise 387
m_SizeField1 = New_SizeField1
If m_SizeNumber >= 1 Then
TSize(1).Text = m_SizeField1
End If
PropertyChanged "SizeField1"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=2,0,2,0
Public Property Get SizeField2() As Currency
Attribute SizeField2.VB_MemberFlags = "141c"
SizeField2 = m_SizeField2
End Property
Public Property Let SizeField2(ByVal New_SizeField2 As Currency)
If Ambient.UserMode = False Then Err.Raise 387
m_SizeField2 = New_SizeField2
If m_SizeNumber >= 2 Then
TSize(2).Text = m_SizeField2
End If
PropertyChanged "SizeField2"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=2,0,2,0
Public Property Get SizeField3() As Currency
Attribute SizeField3.VB_MemberFlags = "141c"
SizeField3 = m_SizeField3
End Property
Public Property Let SizeField3(ByVal New_SizeField3 As Currency)
If Ambient.UserMode = False Then Err.Raise 387
m_SizeField3 = New_SizeField3
If m_SizeNumber >= 3 Then
TSize(3).Text = m_SizeField3
End If
PropertyChanged "SizeField3"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=2,0,2,0
Public Property Get SizeField4() As Currency
Attribute SizeField4.VB_MemberFlags = "141c"
SizeField4 = m_SizeField4
End Property
Public Property Let SizeField4(ByVal New_SizeField4 As Currency)
If Ambient.UserMode = False Then Err.Raise 387
m_SizeField4 = New_SizeField4
If m_SizeNumber >= 4 Then
TSize(4).Text = m_SizeField4
End If
PropertyChanged "SizeField4"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=2,0,2,0
Public Property Get SizeField5() As Currency
Attribute SizeField5.VB_MemberFlags = "141c"
SizeField5 = m_SizeField5
End Property
Public Property Let SizeField5(ByVal New_SizeField5 As Currency)
If Ambient.UserMode = False Then Err.Raise 387
m_SizeField5 = New_SizeField5
If m_SizeNumber >= 5 Then
TSize(5).Text = m_SizeField5
End If
PropertyChanged "SizeField5"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=2,0,2,0
Public Property Get SizeField6() As Currency
Attribute SizeField6.VB_MemberFlags = "141c"
SizeField6 = m_SizeField6
End Property
Public Property Let SizeField6(ByVal New_SizeField6 As Currency)
If Ambient.UserMode = False Then Err.Raise 387
m_SizeField6 = New_SizeField6
If m_SizeNumber >= 6 Then
TSize(6).Text = m_SizeField6
End If
PropertyChanged "SizeField6"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=2,0,2,0
Public Property Get SizeField7() As Currency
Attribute SizeField7.VB_MemberFlags = "141c"
SizeField7 = m_SizeField7
End Property
Public Property Let SizeField7(ByVal New_SizeField7 As Currency)
If Ambient.UserMode = False Then Err.Raise 387
m_SizeField7 = New_SizeField7
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -