📄 superimage.ctl
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.UserControl SuperImage
ClientHeight = 1455
ClientLeft = 0
ClientTop = 0
ClientWidth = 750
ScaleHeight = 1455
ScaleWidth = 750
Begin VB.VScrollBar VS
Height = 975
Left = 480
Max = 34
Min = 1
TabIndex = 1
Top = 480
Value = 1
Width = 255
End
Begin VB.CommandButton Command1
Caption = "▲"
Height = 495
Left = 480
TabIndex = 0
Top = 0
Width = 255
End
Begin MSComctlLib.ImageList ImageList1
Left = 0
Top = 240
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 34
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":0000
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":0490
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":0908
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":0D88
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":122C
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":16D0
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":1B54
Key = ""
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":2004
Key = ""
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":2498
Key = ""
EndProperty
BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":293C
Key = ""
EndProperty
BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":2DF8
Key = ""
EndProperty
BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":3254
Key = ""
EndProperty
BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":36CC
Key = ""
EndProperty
BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":3B88
Key = ""
EndProperty
BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":4008
Key = ""
EndProperty
BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":442C
Key = ""
EndProperty
BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":48A4
Key = ""
EndProperty
BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":4CCC
Key = ""
EndProperty
BeginProperty ListImage19 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":5170
Key = ""
EndProperty
BeginProperty ListImage20 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":5618
Key = ""
EndProperty
BeginProperty ListImage21 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":5AA4
Key = ""
EndProperty
BeginProperty ListImage22 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":5F1C
Key = ""
EndProperty
BeginProperty ListImage23 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":63D8
Key = ""
EndProperty
BeginProperty ListImage24 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":6828
Key = ""
EndProperty
BeginProperty ListImage25 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":6C6C
Key = ""
EndProperty
BeginProperty ListImage26 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":70F8
Key = ""
EndProperty
BeginProperty ListImage27 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":7540
Key = ""
EndProperty
BeginProperty ListImage28 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":79C4
Key = ""
EndProperty
BeginProperty ListImage29 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":7E3C
Key = ""
EndProperty
BeginProperty ListImage30 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":82C8
Key = ""
EndProperty
BeginProperty ListImage31 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":876C
Key = ""
EndProperty
BeginProperty ListImage32 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":8B98
Key = ""
EndProperty
BeginProperty ListImage33 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":9028
Key = ""
EndProperty
BeginProperty ListImage34 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "SuperImage.ctx":9504
Key = ""
EndProperty
EndProperty
End
Begin VB.Image Image2
Height = 495
Left = 0
Top = 960
Width = 495
End
Begin VB.Image Image1
Height = 495
Left = 0
Top = 480
Width = 495
End
Begin VB.Image Ij
Height = 480
Left = 0
Picture = "SuperImage.ctx":995C
Top = 0
Width = 480
End
End
Attribute VB_Name = "SuperImage"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Dim NowID As Long
Public NowValue As Long
Private e As Boolean '用来判断控件的大小
'缺省属性值:
Const m_def_ForeColor = 0
Const m_def_Enabled = 0
'属性变量:
Dim m_ForeColor As Long
Dim m_Enabled As Boolean
Dim m_Font As Font
'事件声明:
Event Click(Cancel As Boolean)
Attribute Click.VB_Description = "当控件把焦点移交到引起有效性验证的控件时发生。"
'Event Click() 'MappingInfo=Image1,Image1,-1,Click
Event DblClick()
Event EndChoose(index As Long)
Event KeyDown(KeyCode As Integer, Shift As Integer)
Attribute KeyDown.VB_Description = "当用户在拥有焦点的对象上按下任意键时发生。"
Event KeyPress(KeyAscii As Integer)
Attribute KeyPress.VB_Description = "当用户按下和释放 ANSI 键时发生。"
Event KeyUp(KeyCode As Integer, Shift As Integer)
Attribute KeyUp.VB_Description = "当用户在拥有焦点的对象上释放键时发生。"
Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Attribute MouseDown.VB_Description = "当用户在拥有焦点的对象上按下鼠标按钮时发生。"
Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Attribute MouseMove.VB_Description = "当用户移动鼠标时发生。"
Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Attribute MouseUp.VB_Description = "当用户在拥有焦点的对象上释放鼠标发生。"
'注意!不要删除或修改下列被注释的行!
'MemberInfo=8,0,0,0
Public Property Get ForeColor() As Long
Attribute ForeColor.VB_Description = "返回/设置对象中文本和图形的前景色。"
ForeColor = m_ForeColor
End Property
Public Property Let ForeColor(ByVal New_ForeColor As Long)
m_ForeColor = New_ForeColor
PropertyChanged "ForeColor"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=0,0,0,0
Public Property Get Enabled() As Boolean
Attribute Enabled.VB_Description = "返回/设置一个值,决定一个对象是否响应用户生成事件。"
Enabled = m_Enabled
End Property
Public Property Let Enabled(ByVal New_Enabled As Boolean)
m_Enabled = New_Enabled
PropertyChanged "Enabled"
End Property
'注意!不要删除或修改下列被注释的行!
'MemberInfo=6,0,0,0
Public Property Get Font() As Font
Attribute Font.VB_Description = "返回一个 Font 对象。"
Attribute Font.VB_UserMemId = -512
Set Font = m_Font
End Property
Public Property Set Font(ByVal New_Font As Font)
Set m_Font = New_Font
PropertyChanged "Font"
End Property
Private Sub Command1_Click()
If e = False Then
UserControl.Height = Command1.Height + VS.Height
If VS.Value = 34 Then
Image1.Picture = ImageList1.ListImages(33).Picture
Image2.Picture = ImageList1.ListImages(34).Picture
NowID = 33
Else
Image1.Picture = ImageList1.ListImages(VS.Value).Picture
Image2.Picture = ImageList1.ListImages(VS.Value + 1).Picture
NowID = VS.Value
End If
e = True
ElseIf e = True Then
UserControl.Height = UserControl.Height - VS.Height
e = False
End If
End Sub
Private Sub Image1_Click()
Ij.Picture = Image1.Picture '把选定的图片给Ij
UserControl.Height = UserControl.Height - VS.Height '使控件回到原来的大小
e = False
RaiseEvent EndChoose(NowID)
NowValue = NowID
'RaiseEvent Click
End Sub
Private Sub Image2_Click()
Ij.Picture = Image2.Picture '把选定的图片给Ij
UserControl.Height = UserControl.Height - VS.Height '使控件回到原来的大小
e = False
RaiseEvent EndChoose(NowID + 1)
NowValue = NowID + 1
End Sub
'为用户控件初始化属性
Private Sub UserControl_InitProperties()
Dim i As Integer
e = False
m_ForeColor = m_def_ForeColor
m_Enabled = m_def_Enabled
Set m_Font = Ambient.Font
' For i = 1 To 2
' Load Ij(i)
' Ij(i).Visible = True
' Ij(i).Top = Ij(i - 1)
' Next i
'Ij(0).Picture = ImageList1.ListImages(1).Picture
'Ij(1).Picture = ImageList1.ListImages(2).Picture
UserControl.Width = Ij.Width + Command1.Width
UserControl.Height = Command1.Height
Ij.Picture = ImageList1.ListImages(1).Picture
'Image1.Picture = ImageList1.ListImages(1).Picture
'Image2.Picture = ImageList1.ListImages(2).Picture
End Sub
'从存贮器中加载属性值
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
m_ForeColor = PropBag.ReadProperty("ForeColor", m_def_ForeColor)
m_Enabled = PropBag.ReadProperty("Enabled", m_def_Enabled)
Set m_Font = PropBag.ReadProperty("Font", Ambient.Font)
End Sub
Private Sub UserControl_Resize()
'UserControl.Width = Ij.Width + Command1.Width
'UserControl.Height = Command1.Height
End Sub
'将属性值写到存储器
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("ForeColor", m_ForeColor, m_def_ForeColor)
Call PropBag.WriteProperty("Enabled", m_Enabled, m_def_Enabled)
Call PropBag.WriteProperty("Font", m_Font, Ambient.Font)
End Sub
Private Sub VS_Change()
If VS.Value = 34 Then
Image1.Picture = ImageList1.ListImages(33).Picture
Image2.Picture = ImageList1.ListImages(34).Picture
NowID = 33
Else
Image1.Picture = ImageList1.ListImages(VS.Value).Picture
Image2.Picture = ImageList1.ListImages(VS.Value + 1).Picture
NowID = VS.Value
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -