📄 ctrl_listobject.ctl
字号:
With UserControl
.pic_UpBorder.Width = .Width
.pic_UpBorder.Height = 360
v_lRtn = BitBlt(.pic_UpBorder.hdc, 0, 0, 20, 24, .pic_Source.hdc, 0, 0, SRCCOPY)
v_iCenterImgFrequency = Abs((.Width / Screen.TwipsPerPixelX) / 20)
If v_iCenterImgFrequency > 0 Then
For v_iLoop = 1 To v_iCenterImgFrequency
v_lRtn = BitBlt(.pic_UpBorder.hdc, v_iLoop * 20, 0, 20, 24, .pic_Source.hdc, 20, 0, SRCCOPY)
Next v_iLoop
End If
v_lRtn = BitBlt(.pic_UpBorder.hdc, (.Width / Screen.TwipsPerPixelX) - 23, 0, 23, 24, .pic_Source.hdc, 44, 0, SRCCOPY)
pic_UpBorder.Refresh
.pic_DownBorder.Width = .Width
.pic_DownBorder.Height = 360
.pic_DownBorder.Top = .Height - .pic_DownBorder.Height
v_lRtn = BitBlt(.pic_DownBorder.hdc, 0, 0, 20, 24, .pic_Source.hdc, 0, 96, SRCCOPY)
v_iCenterImgFrequency = Abs((.Width / Screen.TwipsPerPixelX) / 20)
If v_iCenterImgFrequency > 0 Then
For v_iLoop = 1 To v_iCenterImgFrequency
v_lRtn = BitBlt(.pic_DownBorder.hdc, v_iLoop * 20, 0, 20, 24, .pic_Source.hdc, 20, 96, SRCCOPY)
Next v_iLoop
End If
v_lRtn = BitBlt(.pic_DownBorder.hdc, (.Width / Screen.TwipsPerPixelX) - 23, 0, 23, 24, .pic_Source.hdc, 44, 96, SRCCOPY)
.pic_Viewport.Top = .pic_UpBorder.Height
.pic_Viewport.Width = .Width
.pic_Viewport.Height = .Height - .pic_UpBorder.Height - .pic_DownBorder.Height
v_iCurrentY = 0
While (v_iCurrentY * 15) < (.Height - 720)
v_lRtn = BitBlt(.pic_Viewport.hdc, 0, v_iCurrentY, 20, 24, .pic_Source.hdc, 0, 24, SRCCOPY)
v_iCenterImgFrequency = Abs((.Width / Screen.TwipsPerPixelX) / 20)
If v_iCenterImgFrequency > 0 Then
For v_iLoop = 1 To v_iCenterImgFrequency
v_lRtn = BitBlt(.pic_Viewport.hdc, v_iLoop * 20, v_iCurrentY, 20, 24, .pic_Source.hdc, 20, 24, SRCCOPY)
Next v_iLoop
End If
v_lRtn = BitBlt(.pic_Viewport.hdc, (.Width / Screen.TwipsPerPixelX) - 23, v_iCurrentY, 23, 24, .pic_Source.hdc, 44, 24, SRCCOPY)
v_iCurrentY = v_iCurrentY + 24
Wend
End With
End Sub
Public Sub AddItem(m_Item As String)
With UserControl
If v_iItemCount <> 0 Then
Load .lbl_Item(v_iItemCount)
End If
.lbl_Item(v_iItemCount).Width = .Width
.lbl_Item(v_iItemCount).Top = 360 * v_iItemCount + 75
.lbl_Item(v_iItemCount).Caption = m_Item
.lbl_Item(v_iItemCount).Visible = True
v_iItemCount = v_iItemCount + 1
End With
End Sub
Private Sub UnloadItems()
Dim v_iLoop As Integer
For v_iLoop = 1 To v_iItemCount - 1
Unload UserControl.lbl_Item(v_iLoop)
Next v_iLoop
End Sub
'Public Property Get SkinPath() As String
' SkinPath = v_sSkinPath
'End Property
'Public Property Let SkinPath(ByVal m_SkinPath As String)
' v_sSkinPath = m_SkinPath
' PropertyChanged "SkinPath"
'End Property
Public Property Get ForeColor() As OLE_COLOR
ForeColor = v_oForeColor
End Property
Public Property Let ForeColor(ByVal m_ForeColor As OLE_COLOR)
Dim v_iLoop As Integer
v_oForeColor = m_ForeColor
PropertyChanged "ForeColor"
For v_iLoop = 0 To v_iItemCount - 1
UserControl.lbl_Item(v_iLoop).ForeColor = v_oForeColor
Next v_iLoop
End Property
Public Property Get MouseMoveColor() As OLE_COLOR
MouseMoveColor = v_oMouseMoveColor
End Property
Public Property Let MouseMoveColor(ByVal m_MouseMoveColor As OLE_COLOR)
v_oMouseMoveColor = m_MouseMoveColor
PropertyChanged "MouseMoveColor"
End Property
Public Property Get MouseDownColor() As OLE_COLOR
MouseDownColor = v_oMouseDownColor
End Property
Public Property Let MouseDownColor(ByVal m_MouseDownColor As OLE_COLOR)
v_oMouseDownColor = m_MouseDownColor
PropertyChanged "MouseDownColor"
End Property
Private Sub img_MoveDown_Click()
Dim v_iLoop As Integer
For v_iLoop = 0 To v_iItemCount - 1
UserControl.lbl_Item(v_iLoop).Top = UserControl.lbl_Item(v_iLoop).Top - 360
UserControl.pic_MouseMove.Visible = False
Next v_iLoop
End Sub
Private Sub img_MoveUp_Click()
Dim v_iLoop As Integer
For v_iLoop = 0 To v_iItemCount - 1
UserControl.lbl_Item(v_iLoop).Top = UserControl.lbl_Item(v_iLoop).Top + 360
UserControl.pic_MouseMove.Visible = False
Next v_iLoop
End Sub
Private Sub lbl_Item_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim v_lRtn As Long
Dim v_iCenterImgFrequency As Integer
Dim v_iLoop As Integer
RaiseEvent MouseMove(Index, Button, Shift, X, Y)
v_iLastItem = Index
With UserControl
.pic_MouseMove.Width = .Width
.pic_MouseMove.Height = 360
.pic_MouseMove.Cls
v_lRtn = BitBlt(.pic_MouseMove.hdc, 0, 0, 20, 24, .pic_Source.hdc, 0, 48, SRCCOPY)
v_iCenterImgFrequency = Abs((.Width / Screen.TwipsPerPixelX) / 20)
If v_iCenterImgFrequency > 0 Then
For v_iLoop = 1 To v_iCenterImgFrequency
v_lRtn = BitBlt(.pic_MouseMove.hdc, v_iLoop * 20, 0, 20, 24, .pic_Source.hdc, 23, 48, SRCCOPY)
Next v_iLoop
End If
v_lRtn = BitBlt(.pic_MouseMove.hdc, (.Width / Screen.TwipsPerPixelX) - 23, 0, 23, 24, .pic_Source.hdc, 44, 48, SRCCOPY)
.pic_MouseMove.Top = .lbl_Item(Index).Top - 75
.lbl_MouseMove.Caption = .lbl_Item(Index).Caption
.lbl_MouseMove.ForeColor = MouseMoveColor
.lbl_MouseMove.Width = .Width
.lbl_MouseMove.Top = 75
.pic_MouseMove.Visible = True
End With
End Sub
Private Sub lbl_MouseMove_Click()
RaiseEvent Click(v_iLastItem)
End Sub
Private Sub lbl_MouseMove_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim v_lRtn As Long
Dim v_iCenterImgFrequency As Integer
Dim v_iLoop As Integer
With UserControl
.pic_MouseMove.Width = .Width
.pic_MouseMove.Height = 360
.pic_MouseMove.Cls
.lbl_MouseMove.ForeColor = MouseDownColor
v_lRtn = BitBlt(.pic_MouseMove.hdc, 0, 0, 20, 24, .pic_Source.hdc, 0, 72, SRCCOPY)
v_iCenterImgFrequency = Abs((.Width / Screen.TwipsPerPixelX) / 20)
If v_iCenterImgFrequency > 0 Then
For v_iLoop = 1 To v_iCenterImgFrequency
v_lRtn = BitBlt(.pic_MouseMove.hdc, v_iLoop * 20, 0, 20, 24, .pic_Source.hdc, 23, 72, SRCCOPY)
Next v_iLoop
End If
v_lRtn = BitBlt(.pic_MouseMove.hdc, (.Width / Screen.TwipsPerPixelX) - 23, 0, 23, 24, .pic_Source.hdc, 44, 72, SRCCOPY)
End With
End Sub
Private Sub UserControl_InitProperties()
'v_sSkinPath = App.Path & "\Skins\Titanium"
v_oForeColor = DefForeColor
v_oMouseMoveColor = DefMouseMoveColor
v_oMouseDownColor = DefMouseDownColor
End Sub
Private Sub UserControl_Resize()
Call Refresh
End Sub
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
'v_sSkinPath = PropBag.ReadProperty("SkinPath", App.Path & "\Skins\Titanium")
'Call DrawMenu
v_oForeColor = PropBag.ReadProperty("ForeColor", DefForeColor)
UserControl.lbl_Item(0).ForeColor = v_oForeColor
v_oMouseMoveColor = PropBag.ReadProperty("MouseMoveColor", DefMouseMoveColor)
UserControl.lbl_MouseMove.ForeColor = v_oMouseMoveColor
v_oMouseDownColor = PropBag.ReadProperty("MouseDownColor", DefMouseDownColor)
End Sub
Private Sub UserControl_Terminate()
Call UnloadItems
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
'Call PropBag.WriteProperty("SkinPath", v_sSkinPath, App.Path & "\Skins\Titanium")
Call PropBag.WriteProperty("ForeColor", v_oForeColor, DefForeColor)
Call PropBag.WriteProperty("MouseMoveColor", v_oMouseMoveColor, DefMouseMoveColor)
Call PropBag.WriteProperty("MouseDownColor", v_oMouseDownColor, DefMouseDownColor)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -