📄 mysizeprint.ctl
字号:
Case 3
TSize(3).Caption = m_SizeField3
Case 4
TSize(4).Caption = m_SizeField4
Case 5
TSize(5).Caption = m_SizeField5
Case 6
TSize(6).Caption = m_SizeField6
Case 7
TSize(7).Caption = m_SizeField7
Case 8
TSize(8).Caption = m_SizeField8
Case 9
TSize(9).Caption = m_SizeField9
Case 10
TSize(10).Caption = m_SizeField10
Case 11
TSize(11).Caption = m_SizeField11
Case 12
TSize(12).Caption = m_SizeField12
Case 13
TSize(13).Caption = m_SizeField13
Case 14
TSize(14).Caption = m_SizeField14
Case 15
TSize(15).Caption = m_SizeField15
Case 16
TSize(16).Caption = m_SizeField16
Case 17
TSize(17).Caption = m_SizeField17
Case 18
TSize(18).Caption = m_SizeField18
Case 19
TSize(19).Caption = m_SizeField19
Case 20
TSize(20).Caption = m_SizeField20
Case 21
TSize(21).Caption = m_SizeField21
Case 22
TSize(22).Caption = m_SizeField22
Case 23
TSize(23).Caption = m_SizeField23
Case 24
TSize(24).Caption = m_SizeField24
Case 25
TSize(25).Caption = m_SizeField25
Case 26
TSize(26).Caption = m_SizeField26
Case 27
TSize(27).Caption = m_SizeField27
Case 28
TSize(28).Caption = m_SizeField28
Case 29
TSize(29).Caption = m_SizeField29
Case 30
TSize(30).Caption = 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).Caption = "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).Caption)
End Property
Public Property Let SizeCount(ByVal New_SizeCount As Currency)
If CanPropertyChange("SizeCount") Then
TSize(0).Caption = 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).Caption = 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).Caption = 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).Caption = 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).Caption = 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).Caption = 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).Caption = 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
If m_SizeNumber >= 7 Then
TSize(7).Caption = m_SizeField7
End If
PropertyChanged "SizeField7"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=2,0,2,0
Public Property Get SizeField8() As Currency
Attribute SizeField8.VB_MemberFlags = "141c"
SizeField8 = m_SizeField8
End Property
Public Property Let SizeField8(ByVal New_SizeField8 As Currency)
If Ambient.UserMode = False Then Err.Raise 387
m_SizeField8 = New_SizeField8
If m_SizeNumber >= 8 Then
TSize(8).Caption = m_SizeField8
End If
PropertyChanged "SizeField8"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=2,0,2,0
Public Property Get SizeField9() As Currency
Attribute SizeField9.VB_MemberFlags = "141c"
SizeField9 = m_SizeField9
End Property
Public Property Let SizeField9(ByVal New_SizeField9 As Currency)
If Ambient.UserMode = False Then Err.Raise 387
m_SizeField9 = New_SizeField9
If m_SizeNumber >= 9 Then
TSize(9).Caption = m_SizeField9
End If
PropertyChanged "SizeField9"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=2,0,2,0
Public Property Get SizeField10() As Currency
Attribute SizeField10.VB_MemberFlags = "141c"
SizeField10 = m_SizeField10
End Property
Public Property Let SizeField10(ByVal New_SizeField10 As Currency)
If Ambient.UserMode = False Then Err.Raise 387
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -